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

change the location of args and options. #1431

Closed
3 tasks done
xbsummer opened this issue Jul 8, 2022 · 2 comments
Closed
3 tasks done

change the location of args and options. #1431

xbsummer opened this issue Jul 8, 2022 · 2 comments
Labels
area/v2 relates to / is being considered for v2 kind/discussion is for discussion kind/feature describes a code enhancement / feature request

Comments

@xbsummer
Copy link

xbsummer commented Jul 8, 2022

Checklist

  • Are you running the latest v2 release? The list of releases is here.
  • Did you check the manual for your release? The v2 manual is here.
  • Did you perform a search about this feature? Here's the Github guide about searching.

What problem does this solve?

Another way of writing on the command line

Solution description

     old:   command [options ...] [arguments...]
 another:   command [arguments...] [options ...] 

example:
     old:   command test -d name=123 -d age=18 -d sex=MALE arg1 arg2 arg3 ....
 another:   command test  arg1 -arg2 arg3 ....  -d name=123  age=18 sex=MALE  #-arg2 not an option

from the example, you can see:
the old way, each option can only be followed by one value, if there are multiple values, must be multiple -d options, If there is no -d option,multiple values may lead to inability to distinguish args.
the another way, an option can be followed by multiple values, multiple values are separated by spaces, if the args are preceded by -, you can verify whether it is an option, until the first option is found, the front is all args

recommended to add a switch, which uses the old parsing mode by default, and use the new parsing mode if the switch is turned on。

Describe alternatives you've considered

A clear and concise description of any alternative solutions or
features you've considered.

@xbsummer xbsummer added area/v2 relates to / is being considered for v2 status/triage maintainers still need to look into this labels Jul 8, 2022
@meatballhat
Copy link
Member

@xbsummer Thank you for taking the time to write this up ❤️ I hope I'm understanding correctly here, so please do say if I'm way off base 😅

Introducing an alternate parser continues to be a popular topic (e.g. #1391), so I don't want to give you the impression that maintainers don't care. The attempts to take on this work so far haven't gone beyond the experimental phase, and feedback from those making such attempts has roughly been that the work is non-trivial (citations needed). All of that being said, I'm personally very interested in the possibility of building on top of a different parser library. Targeting the v3-dev-main branch will likely allow for greater change. Any chance you're up for trying something?

@meatballhat meatballhat added kind/feature describes a code enhancement / feature request kind/discussion is for discussion and removed status/triage maintainers still need to look into this labels Jul 9, 2022
@dearchap
Copy link
Contributor

Duplicate of #1113

@dearchap dearchap marked this as a duplicate of #1113 Oct 21, 2022
@dearchap dearchap closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/discussion is for discussion kind/feature describes a code enhancement / feature request
Projects
None yet
Development

No branches or pull requests

3 participants