Manlio Perillo <[email protected]> writes:
>> + # Skip "git" (first argument)
>> + for ((i=1; i < ${#words[@]}; i++)); do
>> + word="${words[i]}"
>> +
>> + case "$word" in
>> + --)
>
> Sorry, I have incorrectly (again) indented the case labels.
> I have now configured my editor to correctly indent this.
Yeah, thanks for spotting.
I wouldn't worry *too* much about the style in this script at this
point, though. It uses a style on its own that is totally different
from the rest of the system (e.g. "[" instead of "test", semicolon
in "if ...; then", etc.) and it probably is better to emulate the
surrounding code, and leave the style "fixes" to a separate topic,
if we want to (as a contrib/ material that is not POSIX but bash
specific, I do not know if that is even worth it).
>> + # Good; we can assume that the following are
>> only non
>> + # option arguments.
>> + ((c = 0))
>> + ;;
>
> Here I was thinking to do something like this (not tested):
>
> -*)
> if [ -n ${2-} ]; then
> # Assume specified git command only
> # accepts simple options
> # (without arguments)
> ((c = 0))
>
> Since git mv only accepts simple options, this will make the use of '--'
> not required.
Unless you have a file whose name begins with a dash, perhaps?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html