Commit 5bf2952318d28b496aa5f35112a5de7a3f13bbf8

Authored by knodlseder
1 parent f9dae063

improve argument checking

Showing 1 changed file with 3 additions and 3 deletions
examples/ts_distributions.py
... ... @@ -95,13 +95,13 @@ if __name__ == '__main__':
95 95 Create TS distribution in a number of energy bands.
96 96 """
97 97 # Get input arguments
98   - usage = "ts_distributions <max_threads>"
99   - if len(sys.argv) < 1:
  98 + usage = "ts_distributions [max_threads]"
  99 + if len(sys.argv) < 1 or len(sys.argv) > 2:
100 100 print usage
101 101 sys.exit()
102 102  
103 103 # Set maximum number of threads (default: 1)
104   - if len(sys.argv) > 1:
  104 + if len(sys.argv) == 2:
105 105 max_threads = int(sys.argv[1])
106 106 else:
107 107 max_threads = 1
... ...