Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument Parsing in Pax.nim becoming quite messy #60

Open
langedev opened this issue Sep 27, 2021 · 1 comment
Open

Argument Parsing in Pax.nim becoming quite messy #60

langedev opened this issue Sep 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@langedev
Copy link
Contributor

Pax uses Therapist for its argument parsing. I don't have anything against Therapist, but I've found it quite difficult to solve the following problems with it.

My primary problem is how much repetition is in pax.nim. For instance any new command that you add must have common args added to it. If we wanted to add a new argument to every command we would have to edit every command. My thought to fix this was to create a template or proc which would automatically add these, but every command is a tuple in Therapist, and so I was unable to modify them after creation.

Similarly at the bottom of pax.nim is a list of conditionals checking for any given command, and any time a new command is added you have to add it to this bottom list as well.

This has really halted my progress on #42 and I'd love to fix this. If we are attached to the formatting of therapist I'm happy to provide an interface to communicate between some easier method of creating commands and using therapist. Otherwise I'm also happy to write something in Nim's provided parser. If there is no interest that is also fine, I'll just finish up #42 as I know there is interest in finishing it before 2.0

@maradotwebp
Copy link
Owner

Truth be told, I'm also not too happy about Therapist. I've been using cligen before, which I wasn't too happy with because generating custom help messages was a pain.

You could try taking a look at argparse, which out of all available options looks like it would be best for pax (judging from one glance).

@maradotwebp maradotwebp added the enhancement New feature or request label Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants