aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-19 03:30:11 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-19 03:30:11 +0200
commitafcc9dc82981e6b334e5b4d8e79e19925ca9600e (patch)
treed65b1dfbb9a49b921f3a297f0eec51503caeb45d
parent50a53b99aa368b2d69aea5eb6545fb5fcd8aa2dd (diff)
downloadponysay-afcc9dc82981e6b334e5b4d8e79e19925ca9600e.tar.gz
ponysay-afcc9dc82981e6b334e5b4d8e79e19925ca9600e.tar.bz2
ponysay-afcc9dc82981e6b334e5b4d8e79e19925ca9600e.zip
info update + bash completion improvement (long options are suggested)
-rw-r--r--completion/bash-completion.sh6
-rw-r--r--manuals/ponysay.texinfo24
2 files changed, 27 insertions, 3 deletions
diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh
index 11b99ea..ca6755e 100644
--- a/completion/bash-completion.sh
+++ b/completion/bash-completion.sh
@@ -8,15 +8,15 @@ _ponysay()
options='-v -h -l -f -W -q'
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
- if [ $prev = "-f" ]; then
+ if [ $prev = "-f" ] || [ $prev = "--pony" ]; then
ponies=$('/usr/bin/ponysay.py' --onelist)
COMPREPLY=( $( compgen -W "$ponies" -- "$cur" ) )
- elif [ $prev = "-q" ]; then
+ elif [ $prev = "-q" ] || [ $prev = "--quote" ]; then
quoters=$('/usr/bin/ponysay.py' --quoters)
COMPREPLY=( $( compgen -W "$quoters" -- "$cur" ) )
- elif [ $prev = "-W" ]; then
+ elif [ $prev = "-W" ] || [ $prev = "--wrap" ]; then
cols=$(( `stty size | cut -d ' ' -f 2` - 10 ))
COMPREPLY=( $cols $(( $cols / 2 )) 100 60 )
diff --git a/manuals/ponysay.texinfo b/manuals/ponysay.texinfo
index b4128c6..10ee03a 100644
--- a/manuals/ponysay.texinfo
+++ b/manuals/ponysay.texinfo
@@ -766,6 +766,7 @@ but is still available at @url{https://github.com/maandree/kmsponies4ponysay}.
* Printing in TTY with KMS:: Printing in TTY with KMS.
* Truncation:: Output truncation.
* Languages:: Selection of languages.
+* Shell auto-completion:: Things make auto-completion simplier.
@end menu
@@ -855,6 +856,28 @@ However since version 2.0 we are trying to move from all there languages
and only use Python 3.
+@node Shell auto-completion
+@section Shell auto-completion
+@cindex auto-completion, inner workings
+@cindex shell, auto-completion
+@cindex @command{--onelist}
+@cindex @command{--quoters}
+
+To make it easier to write auto-completion for shells, @command{ponysay} supports
+the two options @command{--onelist} and @command{--quoters}, which has not short
+versions.
+
+Executing @command{ponysay --onelist} will list every available pony,
+independent of where it is located, the output is a sorted and consists only
+of one pony per line.
+
+@command{ponysay --quoters} work just as @command{ponysay --onelist}, excepts
+it limites the ponies to those that have quotes. Ponies that have qoutes,
+but does not exist, i.e. does not have a .pony-file, are not listed.
+
+Auto-completion scripts should not suggest these options.
+
+
@node Contributing
@chapter Contributing
@@ -1249,6 +1272,7 @@ Patchers and other contributors of ponysay:
@end itemize
+
@node Ponysay license
@appendix Ponysay license