aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-10-25 02:36:35 +0200
committerMattias Andrée <maandree@operamail.com>2012-10-25 02:36:35 +0200
commit13308a6880608454906ac2f1d87a8e39f87ef48c (patch)
tree3b189ff6847f6a0a3bc3daed919d5f864f9f6c54
parent96abf11f46d9fc39593fbc1e92e372c9d864f037 (diff)
downloadponysay-13308a6880608454906ac2f1d87a8e39f87ef48c.tar.gz
ponysay-13308a6880608454906ac2f1d87a8e39f87ef48c.tar.bz2
ponysay-13308a6880608454906ac2f1d87a8e39f87ef48c.zip
enable --F and --f without argument, this way you can get any random extrapony by ending the commmand line with just --F
-rw-r--r--manuals/ponysay.texinfo3
-rwxr-xr-xponysay.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/manuals/ponysay.texinfo b/manuals/ponysay.texinfo
index fd34717..703719e 100644
--- a/manuals/ponysay.texinfo
+++ b/manuals/ponysay.texinfo
@@ -216,6 +216,9 @@ Variadic variant of @option{-F}, meaning that all arguments added after this one
will parsed as an argument to this option. Additionally, those options are added
to @option{-F}.
+An important feature of this options, is that you can but it in the end of the
+command line, without any argument to get a random non-MLP:FiM pony.
+
@item --q [PONY...]
@itemx --quotes [PONY...]
@opindex @option{--q}
diff --git a/ponysay.py b/ponysay.py
index de6997a..51f8c72 100755
--- a/ponysay.py
+++ b/ponysay.py
@@ -319,13 +319,13 @@ class Ponysay():
ponies[pony] = ponydir + ponyfile
## Support for explicit pony file names
- if not names == None:
+ if names is not None:
for name in names:
if os.path.exists(name):
ponies[name] = name
## If there is not select ponies, choose all of them
- if names == None:
+ if (names is None) or (len(names) == 0):
names = list(ponies.keys())
## Select a random pony of the choosen onles