Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: minor annoyance with zsh and git flow
- X-seq: zsh-users 16050
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: minor annoyance with zsh and git flow
- Date: Wed, 25 May 2011 17:22:34 -0700
- In-reply-to: <BANLkTinpJSkSfjM6WyxodxL+oV=QUExDog@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <BANLkTinpJSkSfjM6WyxodxL+oV=QUExDog@mail.gmail.com>
On May 25, 11:25am, Rick DeNatale wrote:
}
} git flow adds a subcommand to git.
Of course the root of all this is that "subcommands" are not a concept
that unix-derived shells were ever designed to deal with. This ...
} The git flow subcommand has lower level subcommands itself
... is just adding injury to insult.
(Sorry, my curmudgeon is showing.)
} ->git flow feature checkout make_it_niftier
}
} and hit enter, zsh helpfully? asks
}
} zsh: correct 'feature' to 'features'
}
} I can't figure out how to stop zsh from doing this.
You can't unless you're willing to unsetopt correctall. Zsh assumes
that anything after the command word that doesn't start with a hyphen
is an ordinary argument, and the most common kind of ordinary argument
is a file name, and there you are.
} Ideas
Well ... you can hack something ... like so:
zle-line-init() {
# Reset correctall in case finish unset it
setopt no_localoptions correctall
}
zle-line-finish() {
if [[ $BUFFER = (${~CORRECTALL_IGNORE})* ]]
then setopt no_localoptions no_correctall
fi
}
zle -N zle-line-init
zle -N zle-line-finish
CORRECTALL_IGNORE="git flow feature "
Here CORRECTALL_IGNORE is a pattern, so you can add alternatives with
"|" between, etc.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author