nixosbrasil / climod

Modular generated command line interfaces using the same technology as the NixOS module system.
41 stars 6 forks source link

Refactor strategy: API similar to Python's argparse #12

Open lucasew opened 1 year ago

lucasew commented 1 year ago

Although argparse [1] has some imperative traits, we could use some of the related tools and semantics to inspire a Nix declarative API

For completions, there is argcomplete [2] that can north us to a nice completion implementation.

I actually do not have exactly much idea and time to work on this. Most of, if not all, the API will be changed.

[1] https://docs.python.org/3/library/argparse.html [2] https://github.com/kislyuk/argcomplete

adrian-gierakowski commented 1 year ago

If you are planning a major refactor then maybe something could be learned from https://github.com/DannyBen/bashly, which does pretty much the same thing as climod and https://typer.tiangolo.com/ which provides completions for Bash, Zsh, Fish and PowerShell.