Python Forum
review of command line parsers
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
review of command line parsers
#1
i am doing a project where it makes sense to me to use a separate option (and maybe also argument) parser. i need one that supports some specific features:

1. options that can begin with - and others using the same letters beginning with +.

2. options that have a single letter form can be combined in the same argument.

3. combing #1 and #2 by using an extra prefix character. so you could have an option like "-cf+xz" that is the same as "-cf +xz"

4. in place value assignment for last option of a mix like "-cf=.config/foo" instead of "-c -f .config/foo"

5. support for long options with -- and ++ prefixes.

has anyone become aware of any reviews that include advanced parsers like that?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Maybe click?

1 and 5: https://click.palletsprojects.com/en/7.x...characters

I'm not sure about the other requirements, though.
Reply
#3
(Mar-11-2021, 06:44 PM)nilamo Wrote: Maybe click?

1 and 5: https://click.palletsprojects.com/en/7.x...characters

I'm not sure about the other requirements, though.

that looked more like one parser and not a review of parsers, and a big complicated one at that. i will be having different commands in different files while click seemed to expect multiple commands to be bunched up into one file.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  command line options Skaperen 5 2,661 Aug-14-2020, 08:48 AM
Last Post: DeaD_EyE
  opening python from the command line takes a long time to load? abdulkaderanwar 4 2,986 Jun-22-2020, 03:42 AM
Last Post: abdulkaderanwar
  f-string in command line arguments Skaperen 0 1,574 May-05-2020, 11:49 PM
Last Post: Skaperen
  my own command line option parser Skaperen 0 1,662 Mar-27-2020, 04:14 AM
Last Post: Skaperen
  i need a module for more involved command line parsing Skaperen 21 7,112 Sep-04-2019, 02:18 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020