Browse files

Show help text when no filename was given

  • Loading branch information...
1 parent b5850d0 commit ba22ba25ec7c682c58823423ee2ce5c9e35fa902 @vortec vortec committed Mar 19, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 prescons/prescons.py
View
9 prescons/prescons.py
@@ -104,7 +104,10 @@ def get_raw_input(self, prompt):
return input(prompt)
if __name__ == '__main__':
- path = sys.argv[1]
- console = PseudoInteractiveConsole(path)
- console.interact()
+ if len(sys.argv) != 2:
+ print('Usage: python {} <filename>'.format(sys.argv[0]))
+ else:
+ path = sys.argv[1]
+ console = PseudoInteractiveConsole(path)
+ console.interact()

0 comments on commit ba22ba2

Please sign in to comment.