From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18181 invoked by alias); 24 Aug 2014 04:38:39 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33049 Received: (qmail 15424 invoked from network); 24 Aug 2014 04:38:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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== MIME-Version: 1.0 X-Received: by 10.224.115.134 with SMTP id i6mr22884109qaq.71.1408855110893; Sat, 23 Aug 2014 21:38:30 -0700 (PDT) In-Reply-To: <140822210846.ZM22535@torch.brasslantern.com> References: <53F67562.2030102@gmx.net> <140822210846.ZM22535@torch.brasslantern.com> Date: Sun, 24 Aug 2014 06:38:30 +0200 Message-ID: Subject: Re: Bug path completion chsh -s From: Mikael Magnusson To: Bart Schaefer Cc: qcd@gmx.net, zsh workers Content-Type: text/plain; charset=UTF-8 On 23 August 2014 06:08, Bart Schaefer wrote: > On Aug 22, 12:40am, qcd wrote: > } > } > chsh -s > } > } 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:($( "($opts)--shell[Specify your login shell]:shell:($( "($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