I\'m trying to make a verbose flag for my Python program. Currently, I\'m doing this:
import click
#global variable
verboseFlag = False
#parse arguments
@click
The above answer was helpful, but this is what I ended up using. I thought I'd share since so many people are looking at this question:
@click.command()
@click.option('--verbose', '-v', is_flag=True, help="Print more output.")
def main(verbose):
if verbose:
# do something
if __name__ == "__main__":
# pylint: disable=no-value-for-parameter
main()