I'm trying to learn using the module click to create CLI arguments parsing, and wanted to try something different from Argparse.
However, I tried to follow the official documentation, youtube examples and so forth and click just ignores anything I throw at it.
I've tried on Ubuntu 16.04 and Mac OSX, using:
[Python Version]
Python 2.7.13 :: Anaconda custom (x86_64)
[Click Version]
Version: 6.7
This is the code (copied from a tutorial):
import click
@click.command()
@click.option('--verbose', is_flag=True, help="Will print verbose messages.")
def cli(verbose):
if verbose:
click.echo("We are in the verbose mode.")
click.echo("Hello World")
When I run it... nothing happens. No error. Just nothing. What can be wrong? I installed click using "pip install click", and tried on two OS'es.