Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: add cli parameter to increase verbosity level #19

Open
saerdnaer opened this issue Oct 31, 2017 · 1 comment
Open

Idea: add cli parameter to increase verbosity level #19

saerdnaer opened this issue Oct 31, 2017 · 1 comment

Comments

@saerdnaer
Copy link
Member

e.g. ./make.py subscibe9 --debug -v or even ./make.py subscibe9 --debug -vvv to print output from inkscape to stdout. Is there a default pattern for python to achieve this or do I have to use global variables and multiple options to ArgumentParser?

@MaZderMind
Copy link
Contributor

@saerdnaer argparse has a count-action for this:

>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--verbose', '-v', action='count')
>>> parser.parse_args(['-vvv'])
Namespace(verbose=3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants