Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: zmv with alternative commands



On Jul 3,  5:06pm, Peter Stephenson wrote:
} Subject: Re: PATCH: zmv with alternative commands
}
} > } I encountered two problems: zmv doesn't split the words of the program
} > } you supply with -p, and also "p4 integrate" doesn't understand a
} > } following "--" to indicate the end of options for the subcommand.  I've
} > } introduced -P for the latter case.
} > 
} > Perhaps -P could itself take an argument which is the end-of-options
} > marker?  E.g. some older commands don't understand "--" but do accept
} > a single "-" all by itself.
} 
} That will already work since the end-of-option marker comes after the
} program:
} 
}   zmv -P "cp --" foo bar

So if I were to do

    zmv -P -o"-b -d" "cp --" ...

??  No, I'd have to put the separator in the -o string.

Given that, what can you do with a word-splitting -p option

    zmv -p "cmd arg1 arg2" ...

that you can't do with

    zmv -o "arg1 arg2" cmd ...

instead?  If -p splits, do we even need -o any more, or is there a reason
that splitting with -o was separated from providing the command with -p?



Messages sorted by: Reverse Date, Date, Thread, Author