It's probably a case of #bikesheding, but I've been really unhappy with the #python 's #argparse library for a while now. It's okay for run of the mill tools, but fails for more complex command line tools that have subcommands and complex options like --no-except to negate an option.

This is my first cut writing a command line parser for a #cli

https://github.com/sumanthvepa/experiments/tree/develop/python/parse-dralithus-cmdline

experiments/python/parse-dralithus-cmdline at develop · sumanthvepa/experiments

Experiments is a repository of programming experiments that I written to explore various aspects of programming and technology - sumanthvepa/experiments

GitHub
@sumanthvepa it’s solving more problems than argparse but click is a fantastic library for building a CLI.

@elebertus Yes. Click is quite nice. But I wanted to experiment with a slightly different style of parser. It's more of an experiment. I'll probably use something out of the box eventually.

https://click.palletsprojects.com/en/stable/ #cli #click.

Welcome to Click — Click Documentation (8.2.x)

@sumanthvepa I’m definitely not saying do not build your own – sometimes you just got to scratch an itch! – but you might want to take a look at Click and Typer for inspiration.
@tero Eventually, I'm fairly certain that one of the devs on my team will rip out my experimental code and replace it with one of these libraries. They have strong opinions and one of them seems to be to not let the boss's itches affect code base too much. 😃

@sumanthvepa That’s a very sensible stance!

Also, good bossing letting the devs replace your code with a properly maintained library!

@sumanthvepa

argparse is maybe-okay for simple things, but I don't use it for pretty much anything anymore. Have you tried one of the other extant packages that provide higher-level, more-powerful option handling?

I use `click` extensively for complex multiple-command CLI tools.

#click #optparse #argparse #CLI

@cazabon I've played around with #click. I'll probably use that in production.

I was curious to see what it would take to build a command line parser. While it's not terribly difficult, it may not be code that I want maintain.