changeset 340:ef1206634939

witch: Show help when no command is specified.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 30 Aug 2015 21:45:42 -0700
parents 64acfb58e023
children 37f426e067c4
files wikked/witch.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/wikked/witch.py	Fri Aug 28 23:12:22 2015 -0700
+++ b/wikked/witch.py	Sun Aug 30 21:45:42 2015 -0700
@@ -119,6 +119,11 @@
     # Parse!
     result = parser.parse_args()
 
+    # Print the help if no command was specified.
+    if not hasattr(result, 'func'):
+        parser.print_help()
+        return 0
+
     # Create the wiki.
     root = find_wiki_root(result.root)
     if root: