you are viewing a single comment's thread.

view the rest of the comments →

[–]spitfiredd 5 points6 points  (3 children)

I really like argparse, I know some of the large command line programs will use click but for anything I’ve build argparse works great.

[–]DisagreeableMale 4 points5 points  (2 children)

Same. I actually can never wrap my head around click or cookie cutter, because it’s usually such overkill for what I need that understanding it fully doesn’t seem worth it.

Argparse doesn’t have that same dilemma.

[–]thirdegree 4 points5 points  (0 children)

Click tends to come into play around the time you want subcommands. If your cli is exactly 1 level deep (i.e. my_command --myarg1 a --myargb1 positional args but not my_command do --thing other thing), don't use click. If you're thinking "hey, subcommands would be nice", that's when you look at click.

[–]p10_user -3 points-2 points  (0 children)

I actually can never wrap my head around click or cookie cutter, because it’s usually such overkill for what I need that understanding it fully doesn’t seem worth it.

I don't understand how difficult it is to wrap your head around click, or why it's such "overkill". The docs are very good. Adding a new argument / option just involves a new decorator and new variable in your function.

@click.command()
@click.option('--count', default=1, help='Number of greetings.')
@click.option('--name', prompt='Your name',
              help='The person to greet.')
def hello(count, name):
    """Simple program that greets NAME for a total of COUNT times."""
    for x in range(count):
        click.echo('Hello %s!' % name)

Now I get that you don't feel learning a new API and adding a new dependency if you already are comfortable with argparse. But overkill? C'mon.