Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug path completion chsh -s
- X-seq: zsh-workers 33049
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Bug path completion chsh -s
- Date: Sun, 24 Aug 2014 06:38:30 +0200
- Cc: qcd@xxxxxxx, zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BBQYtLZi2TOfpJQwW89/wV2+eQxeoF22tOvCuRkCZ3k=; b=fcGR0yupmDzAW8xAhDL2Sc48YIEdeDqcHdm4K/JBSp8Z5fO8r7tlnKmuuwN+glNBNT des6zPIaO7/cxaBbAVxsGrkSUVM5E2q/cu8RsbfyV9Wx/qatvNFVew/hWqoDxoPEmXeB 2oP2EFhD32gtJycC+34gI1wWrFTF5z8Vufc87va9cliQUjMLbU/lAlt+kwUXI4bhY0Dw 8uNaOL97xuPcoHB9wmu2U5u/nrvzb2gNnKWS0Fc9fSOSn0cXK6LtwNrvIttTf/jv+XDU OmccWRa7K1zJM2viqP/TiXCZWNXdzLqUUmp1KVoC3LNf0cwCINLU2nLkXrQcto3jzcsv +2yQ==
- In-reply-to: <140822210846.ZM22535@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <53F67562.2030102@gmx.net> <140822210846.ZM22535@torch.brasslantern.com>
On 23 August 2014 06:08, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 22, 12:40am, qcd wrote:
> }
> } > chsh -s <tab>
> }
> } in normal shellproposes a path list but in zsh that does not work.
>
> What is "normal shell"? Bash? What version? Are you on a single-user
> system you set up yourself, or are you at a school or business where an
> administrator has pre-configured the "normal shell"?
>
> Also, chsh has different syntax on different OS's: On MacOS it's an
> alias for chpass; on Ubuntu it only has --help and --shell options
> (and their -h -s counterparts); on RHEL it has several options and
> uses -u instead of -h for --help, and adds -l for --list, both of
> which conflict with chpass on MacOs; and so on. So "please fix" is
> a rather open-ended request.
>
> Oh well, never mind. Here's something for RHEL; perhaps you can figure
> out how to fix it for your local environment, or just remove everything
> except -s, given that's the one thing they all seem to have in common.
>
> ---- 8< ---- name this _chsh and put in an fpath directory ---- 8< ----
> #compdef chsh
> local -a opts
> opts=(-s -l -u -v --shell --list-shells --help --version)
> _arguments : \
> "($opts)-s[Specify your login shell]:shell:($(</etc/shells))" \
> "($opts)--shell[Specify your login shell]:shell:($(</etc/shells))" \
> "($opts)-l[Print shells in /etc/shells]" \
> "($opts)--list-shells[Print shells in /etc/shells]" \
> "($opts)-u[Print a usage message and exit]" \
> "($opts)--help[Print a usage message and exit]" \
> "($opts)-v[Print version information and exit]" \
> "($opts)--version[Print version information and exit]"
> ---- 8< ---- snip ---- 8< ---- -------- ---- 8< ---- snip ---- 8< ----
>
> Maybe somebody else can remind me if there's an easier way to indicate
> to _arguments that all the arguments are mutually exclusive. (RedHat
> chsh accepts more than one but only uses the first one it encounters.)
chsh is listed on the compdef line of _users, so you need to remove
that as well. (maybe not since c comes before u, but we still should
remove it if this is committed).
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author