Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. parser.add_argument('-s', '--staged', action=FooAction)
  2.  
  3. class FooAction(argparse.Action):
  4. def __call__(self, parser, namespace, values, option_string=None):
  5. print("action")
  6.  
  7. python my_script -s
  8.  
  9. test.py: error: argument -s/--staged: expected one argument
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement