add ++quotes and --Quoters

Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
Mattias Andrée 2013-04-23 08:50:31 +02:00
parent cf122c4a8c
commit af71317774
3 changed files with 15 additions and 3 deletions

View file

@ -2571,12 +2571,15 @@ use Python 3, which as been accomplished in version 2.1.
@opindex @option{++onelist}
@opindex @option{--Onelist}
@opindex @option{--quoters}
@opindex @option{++quoters}
@opindex @option{--Quoters}
@pindex @command{auto-auto-complete}
To make it easier to write auto-completion for shells, @command{ponysay} supports
the options @option{--onelist}, @option{++onelist}, @option{--Onelist} and
@option{--quoters}, which has no short versions. To make it even easier we use
@command{auto-auto-complete} (@url{https://www.github.com/maandree/auto-auto-complete})
the options @option{--onelist}, @option{++onelist}, @option{--Onelist},
@option{--quoters} @option{++quoters} and @option{--Quoters}, which has no short
versions. To make it even easier we use @command{auto-auto-complete}
(@url{https://www.github.com/maandree/auto-auto-complete})
to generate auto-completion scripts, currently it supports @command{bash},
@command{fish} and @command{zsh}, the built system uses that program to generate
completion for each shell.
@ -2597,6 +2600,11 @@ consists only of one pony per line.
it limits the ponies to those that have quotes. Ponies that have quotes,
but does not exist, i.e. does not have a .pony-file, are not listed.
@command{ponysay ++quoters} is to @command{ponysay --quoters} as
@command{ponysay ++onelist} is to @command{ponysay --onelist} and
@command{ponysay --Quoters} is to @command{ponysay --quoters} as
@command{ponysay --Onelist} is to @command{ponysay --onelist}.
Auto-completion scripts should not suggest these options.

View file

@ -98,6 +98,8 @@ documentation run `info ponysay`, or for just a little more help than this
run `man ponysay`. Ponysay has so much more to offer than described here.''')
opts.add_argumentless(['--quoters'])
opts.add_argumentless(['++quoters'])
opts.add_argumentless(['--Quoters'])
opts.add_argumentless(['--onelist'])
opts.add_argumentless(['++onelist'])
opts.add_argumentless(['--Onelist'])

View file

@ -291,7 +291,9 @@ class Ponysay():
## Run modes
if test('-h'): args.help()
elif test('-v'): self.version()
elif test('--Quoters', ('--quoters', '++quoters')): self.quoters(True, True)
elif test('--quoters'): self.quoters(True, False)
elif test('++quoters'): self.quoters(False, True)
elif test('--Onelist', ('--onelist', '++onelist')): self.onelist(True, True)
elif test('--onelist'): self.onelist(True, False)
elif test('++onelist'): self.onelist(False, True)