diff options
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | completion/bash-completion.sh | 3 | ||||
-rw-r--r-- | completion/fish-completion.fish | 2 | ||||
-rw-r--r-- | manuals/manpage.0 | 8 | ||||
-rw-r--r-- | manuals/manpage.es.0 | 8 | ||||
-rw-r--r-- | manuals/ponysay.texinfo | 50 | ||||
-rwxr-xr-x | ponysay.py | 34 |
7 files changed, 89 insertions, 18 deletions
@@ -11,6 +11,8 @@ Version 2.8 The word wrapper colours the inserted hyphens in red. + Support for terminal capabilities emulation with the flags -X, -V and -K. + Version 2.7 diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh index 4f59a4a..e9c284c 100644 --- a/completion/bash-completion.sh +++ b/completion/bash-completion.sh @@ -5,7 +5,8 @@ _ponysay() local cur prev words cword _init_completion -n = || return - options='--version --help --list --altlist --pony --wrap --quote --balloonlist --balloon --file ++file ++pony ++list ++altlist' + options="--version --help --list --altlist --pony --wrap --quote --balloonlist --balloon --file ++file ++pony ++list ++altlist --all ++all" + options="$options --256-colours --tty-colours --kms-colours" COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) if [ $prev = "-f" ] || [ $prev = "--pony" ] || [ $prev = "--file" ]; then diff --git a/completion/fish-completion.fish b/completion/fish-completion.fish index 68e013a..044dd78 100644 --- a/completion/fish-completion.fish +++ b/completion/fish-completion.fish @@ -9,7 +9,7 @@ set -g quoters ('/usr/bin/ponysay' --quoters) set -g balloons ('/usr/bin/ponysay' --balloonlist) -## TODO: update with options [see info manual]: +l +L ++list ++altlist ++file --file ++pony +## TODO: update with options [see info manual]: +l +L ++list ++altlist ++file --file ++pony {-A, +A, -V, -K, -X}(with alternative) complete --command ponysay --short-option h --long-option help --description 'help of ponysay' complete --command ponysay --short-option v --long-option version --description 'version of ponysay' complete --command ponysay --short-option l --long-option list --description 'list pony names' diff --git a/manuals/manpage.0 b/manuals/manpage.0 index 229ad10..cb653f8 100644 --- a/manuals/manpage.0 +++ b/manuals/manpage.0 @@ -82,12 +82,12 @@ the pony will be selected randomly from that set of ponies. .B \-W, \-\-wrap \fIcolumn\fP The screen column where the message should be wrapped. .TP -.B \-A, \-\-all \fIcolumn\fP -Show all ponies, MLP-FiM and non-MLP-FiM, in this case the first list are MLP:FiM +.B \-A, \-\-all +List all pony files, MLP-FiM and non-MLP-FiM, in this case the first list are MLP:FiM and the second are non-MLP-FiM. .TP -.B \+A, \+\+all \fIcolumn\fP -Show both ponies names, including alternatives, these from MLP:FiM and non-MLP:FiM +.B \+A, \+\+all, \-\-symall, \-\-altall +List all pony files, including alternatives names inside brackets, these from MLP:FiM and non-MLP:FiM the first list are the MLP:FiM and the second one are non-MLP:FiM. .SH ENVIRONMENT .TP diff --git a/manuals/manpage.es.0 b/manuals/manpage.es.0 index f4156ee..5f42fdf 100644 --- a/manuals/manpage.es.0 +++ b/manuals/manpage.es.0 @@ -84,12 +84,12 @@ aleatoriamente uno de este conjunto. .B \-W, \-\-wrap \fIcolumna\fP El numero de columnas en el que serĂ¡ impreso el mensaje. .TP -.B \-A. \-\-all \fIcolumn\fP -Muestra todos los ponis, tanto pertenecientes a MLP:FiM cono no pertenecientes a esta +.B \-A. \-\-all +Lista todos los ponis, tanto pertenecientes a MLP:FiM cono no pertenecientes a esta la primera lista son los pertenecientes a esta y la subsiguente los no pertenecientes. .TP -.B \+A, \+\+all \fIcolumn\fP -Muestra todos los ponies incluyendo sus nombres alternativos, estos pertenecientes a +.B \+A, \+\+all, \-\-symall, \-\-altall +Lista todos los ponis incluyendo sus nombres alternativos, estos pertenecientes a MLP:FiM cono no pertenecientes, la primera lista seran los pertenecientes y la subsiguente los no pertenecientes. .SH ENTORNO diff --git a/manuals/ponysay.texinfo b/manuals/ponysay.texinfo index cca3931..d2f2f6f 100644 --- a/manuals/ponysay.texinfo +++ b/manuals/ponysay.texinfo @@ -266,20 +266,54 @@ Just as @option{-L}, except it lists extra (non-MLP:FiM) ponies instead of stand Prints a list of all balloon styles. @item -A -@itemx --balloonlist +@itemx --all @opindex @option{-A} @opindex @option{--all} -@opindex @option{--all} -Show all ponies, MLP-FiM and non-MLP-FiM, in this case the first list are MLP:FiM -and the second are non-MLP-FiM. +List all ponies, MLP:FiM and non-MLP:FiM, in this case the first list are MLP:FiM +and the second are non-MLP:FiM. @item +A -@itemx --balloonlist +@itemx ++all +@itemx --symall +@itemx --altall @opindex @option{+A} @opindex @option{++all} -@opindex @option{++all} -Show both ponies names, including alternatives, these from MLP:FiM and non-MLP:FiM +@opindex @option{--symall} +@opindex @option{--altall} +List all ponies names, including alternatives, these from MLP:FiM and non-MLP:FiM the first list are the MLP:FiM and the second one are non-MLP:FiM. + +@item -X +@itemx --256-colours +@itemx --256colours +@itemx --x-colours +@opindex @option{-X} +@opindex @option{--256-colours} +@opindex @option{--256colours} +@opindex @option{--x-colours} +Use @command{xterm}'s 256-colour support (supported by most X11 terminals), despite +your terminal's actual compatibilies. + +@item -V +@itemx --tty-colours +@itemx --ttycolours +@itemx --vt-colours +@opindex @option{-V} +@opindex @option{--tty-colours} +@opindex @option{--ttycolours} +@opindex @option{--vt-colours} +Use Linux VT's compatbilies without KMS utilisation, despite your terminal's actual +compatibilies. + +@item -K +@itemx --kms-colours +@itemx --kmscolours +@opindex @option{-K} +@opindex @option{--kms-colours} +@opindex @option{--kmscolours} +Use Linux VT's compatbilies with KMS utilisation, despite your terminal's actual +compatibilies. + @end table @opindex @var{message} @@ -1880,6 +1914,8 @@ Support for explicit hypthenation using soft hyphens had been added to the word Support for explicit non-word wrapping using non-breaking space had been added to the word wrapper. @item The word wrapper colours the inserted hyphens in red. +@item +Support for terminal capabilities emulation with the flags @option{-X}, @option{-V} and @option{-K}. @end itemize @@ -78,9 +78,29 @@ class Ponysay(): elif args.opts['-A'] is not None: self.list(); self.__extraponies(); self.list() elif args.opts['+A'] is not None: self.linklist(); self.__extraponies(); self.linklist() else: + global linuxvt + global usekms + global mode + + ## Emulate termial capabilities + if args.opts['-X'] is not None: + linuxvt = False + usekms = False + elif args.opts['-V'] is not None: + linuxvt = True + usekms = False + elif args.opts['-K'] is not None: + linuxvt = True + usekms = True + + ## Other extra features self.__extraponies(args) self.__bestpony(args) self.__ucsremap(args) + if args.opts['-o'] is not None: + mode += '$/= $$\\= $' + + ## The stuff if args.opts['-q'] is not None: self.quote(args) else: self.print_pony(args) @@ -1209,6 +1229,7 @@ class Backend(): def parse(self): self.__expandMessage() self.__loadFile() + self.pony = mode + self.pony self.__processPony() self.__truncate() @@ -1927,6 +1948,12 @@ usekms = Ponysay.isUsingKMS() ''' +Mode string that modifies or adds $ variables in the pony image +''' +mode = '' + + +''' The directories where pony files are stored, ttyponies/ are used if the terminal is Linux VT (also known as TTY) and not with KMS ''' appendset = set() @@ -2022,6 +2049,10 @@ opts.add_argumentless(['--quoters']) opts.add_argumentless(['--onelist']) opts.add_argumentless(['++onelist']) +opts.add_argumentless(['-X', '--256-colours', '--256colours', '--x-colours']) +opts.add_argumentless(['-V', '--tty-colours', '--ttycolours', '--vt-colours']) +opts.add_argumentless(['-K', '--kms-colours', '--kmscolours']) + opts.add_argumentless(['-h', '--help'], help = 'Print this help message.') opts.add_argumentless(['-v', '--version'], help = 'Print the version of the program.') opts.add_argumentless(['-l', '--list'], help = 'List pony names.') @@ -2029,9 +2060,10 @@ opts.add_argumentless(['-L', '--symlist', '--altlist'], help = opts.add_argumentless(['+l', '++list'], help = 'List non-MLP:FiM pony names.') opts.add_argumentless(['+L', '++symlist', '++altlist'], help = 'List non-MLP:FiM pony names with alternatives.') opts.add_argumentless(['-A', '--all'], help = 'List all pony names.') -opts.add_argumentless(['+A', '++all'], help = 'List all pony names with alternatives.') +opts.add_argumentless(['+A', '++all', '--symall', '--altall'], help = 'List all pony names with alternatives.') opts.add_argumentless(['-B', '--bubblelist', '--balloonlist'], help = 'List balloon styles.') opts.add_argumentless(['-c', '--compact'], help = 'Compress messages.') +opts.add_argumentless(['-o', '--pony-only', '--ponyonly'], help = 'Print only the pony.') opts.add_argumented( ['-W', '--wrap'], arg = 'COLUMN', help = 'Specify column where the message should be wrapped.') opts.add_argumented( ['-b', '--bubble', '--balloon'], arg = 'STYLE', help = 'Select a balloon style.') opts.add_argumented( ['-f', '--file', '--pony'], arg = 'PONY', help = 'Select a pony.\nEither a file name or a pony name.') |