git » galala.git » commit 1c673aa

Check that all needed params are given on generate command

author Rodrigo Campos
2013-08-10 21:43:13 UTC
committer Rodrigo Campos
2013-08-10 21:55:51 UTC
parent 5cf49f56a3c84145570923820bbe8552eb0423cb

Check that all needed params are given on generate command

We only know that the list has at least 3 elements. But we need to use the
fourth element, so we need to check that it has 4 elements.

Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>

galala +3 -0

diff --git a/galala b/galala
index bfcb33d..ceea46c 100755
--- a/galala
+++ b/galala
@@ -170,6 +170,9 @@ if __name__ == '__main__':
     cmd = sys.argv[1]
 
     if cmd == 'generate':
+        if len(sys.argv) != 4:
+            print HELP
+            sys.exit(1)
         page_path = sys.argv[2]
         dst_path = sys.argv[3]
         generate(page_path, dst_path)