tfix parsing of args without option - slidergrid - grid of elastic sliders on a frictional surface
git clone git://src.adamsgaard.dk/slidergrid
Log
Files
Refs
README
LICENSE
---
commit a6eccd98dafded3ca40fdbe13dfa3b8727d90e11
parent 1a2317b2dc0f603bfe2ace1f0d5d93b40efd6a57
Author: Anders Damsgaard 
Date:   Thu, 17 Mar 2016 14:07:21 -0700

fix parsing of args without option

Diffstat:
  M postprocessing.py                   |      11 +++++++----

1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/postprocessing.py b/postprocessing.py
t@@ -58,6 +58,8 @@ def iterate_over_folders(folders, plot_sliders):
 
         if plot_sliders:
             vis.plot_all_sliders()
+        else:
+            print('No actions specified. Bye.')
 
 
 def main(argv):
t@@ -67,8 +69,9 @@ def main(argv):
         opts, args = getopt.getopt(argv, 'hvs',
                                    ['help', 'version', 'plot-sliders'])
     except getopt.GetoptError:
-        print_usage()
-        sys.exit(2)
+        # print_usage()
+        # sys.exit(2)
+        pass
 
     for opt, arg in opts:
         if opt in ('-h', '--help'):
t@@ -82,8 +85,8 @@ def main(argv):
         elif opt in ('-s', '--plot-sliders'):
             plot_sliders = True
 
-        else:
-            folders.append(arg)
+    for arg in args:
+        folders.append(arg)
 
     iterate_over_folders(folders, plot_sliders)