Skip to content

Argument Parsing in Pax.nim becoming quite messy #60

@langedev

Description

@langedev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions