public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Subject: Re: [PATCH 04/10] bash-completion: login-utils
Date: Mon, 1 Apr 2013 17:05:00 +0100	[thread overview]
Message-ID: <20130401160453.GC20549@gmail.com> (raw)
In-Reply-To: <20130328014223.GX526@rampage>

On Wed, Mar 27, 2013 at 09:42:23PM -0400, Dave Reisner wrote:
> On Wed, Mar 27, 2013 at 10:07:46PM +0000, Sami Kerola wrote:
> > +++ b/shell-completion/chfn
> > @@ -0,0 +1,31 @@
> > +_chfn_module()
> > +{
> > +	local cur prev OPTS
> > +	COMPREPLY=()
> > +	cur="${COMP_WORDS[COMP_CWORD]}"
> > +	prev="${COMP_WORDS[COMP_CWORD-1]}"
> > +	case $prev in
> > +		'-f'|'--full-name')
> > +			COMPREPLY=( $(compgen -W "name" -- $cur) )
> > +			return 0
> > +			;;
> > +		'-o'|'--office')
> > +			COMPREPLY=( $(compgen -W "office" -- $cur) )
> > +			return 0
> > +			;;
> > +		'-p'|'--office-phone'|'-h'|'--home-phone')
> > +			COMPREPLY=( $(compgen -W "phone-nr" -- $cur) )
> > +			return 0
> > +			;;
> 
> I don't understand these. Given the previous argument being one of the
> found flags, you're completing staticly defined strings. Why complete
> anything at all?

I thought giving a textual hint to user is good idea.  The hint is now
gone.  Some of the commands are giving similar hints, other are not.  Let
see what is found to be more preferred by users and adjust accordingly.

> > +			OPTS="	-u --user
> > +				-m -p --preserve-environment
> > +				-g --group
> > +				-G --supp-group
> > +				- -l --login
> > +				-c --command
> > +				- -c
> > +				--session-command
> > +				-- -c
> 
> Please don't include the end of options marker in here. You appear to
> have duplicated -c as well.

Good catch, end of options marker is removed.  While writing this reply I
realized that the duplicates are still in my git.  Hold on I'll do rebase
fix to that.

-- 
   Sami Kerola
   http://www.iki.fi/kerolasa/

  reply	other threads:[~2013-04-01 16:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-27 22:07 [PATCH 00/10] [pull] bash-completion Sami Kerola
2013-03-27 22:07 ` [PATCH 01/10] bash-completion: add bash completetion configure option Sami Kerola
2013-03-28 11:22   ` Sami Kerola
2013-03-29  9:42     ` Karel Zak
2013-03-27 22:07 ` [PATCH 02/10] bash-completion: disk-utils Sami Kerola
2013-03-28  1:42   ` Dave Reisner
2013-04-01 15:54     ` Sami Kerola
2013-03-28  9:54   ` Karel Zak
2013-04-01 17:00     ` Sami Kerola
2013-03-27 22:07 ` [PATCH 03/10] bash-completion: fdisks Sami Kerola
2013-03-28 10:01   ` Karel Zak
2013-03-27 22:07 ` [PATCH 04/10] bash-completion: login-utils Sami Kerola
2013-03-28  1:42   ` Dave Reisner
2013-04-01 16:05     ` Sami Kerola [this message]
2013-03-28 10:05   ` Karel Zak
2013-04-01 16:06     ` Sami Kerola
2013-03-27 22:07 ` [PATCH 05/10] bash-completion: misc-utils Sami Kerola
2013-03-28  1:42   ` Dave Reisner
2013-04-01 16:52     ` Sami Kerola
2013-03-27 22:07 ` [PATCH 06/10] bash-completion: schedutils Sami Kerola
2013-03-27 22:07 ` [PATCH 07/10] bash-completion: sys-utils Sami Kerola
2013-03-29 16:33   ` Karel Zak
2013-04-01 16:32     ` Sami Kerola
2013-04-05 14:44   ` Karel Zak
2013-03-27 22:07 ` [PATCH 08/10] bash-completion: term-utils Sami Kerola
2013-03-28 10:06   ` Karel Zak
2013-03-27 22:07 ` [PATCH 09/10] bash-completion: text-utils Sami Kerola
2013-03-27 22:07 ` [PATCH 10/10] bash-completion: add completion files to Makefile.am Sami Kerola
2013-03-28  1:42 ` [PATCH 00/10] [pull] bash-completion Dave Reisner
2013-03-28  9:37 ` Karel Zak
2013-03-31 23:49   ` Sami Kerola
2013-04-01 15:44   ` Sami Kerola
2013-04-05 14:11 ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130401160453.GC20549@gmail.com \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox