3

I just installed the git master branch of IPython. The following:

In [1]: run -m my_packages.my_module -verbosity 20

returns an error:

UsageError: option -v not recognized ( allowed: "nidtN:b:pD:l:rs:T:em:G" )

Even though the following works:

$ python -m my_packages.my_module -verbosity 20

I am using argparse as follows:

parser = argparse.ArgumentParser(description='my_program')
parser.add_argument('-verbosity',   help='Verbosity', required=True)

Any thoughts why?

1 Answer 1

7

Add -- to stop the command-line parsing at a certain point:

In [1]: %run -m my_packages.my_module -- -verbosity 20

This is standard behavior used by argparse for adding extra positional arguments.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.