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

command line options are not sorter, which is confusing #633

Open
yegor256 opened this issue Dec 13, 2024 · 2 comments
Open

command line options are not sorter, which is confusing #633

yegor256 opened this issue Dec 13, 2024 · 2 comments
Assignees

Comments

@yegor256
Copy link
Member

Take a look at this output:

$ eo-phi-normalizer rewrite --help
Usage: eo-phi-normalizer rewrite [-r|--rules FILE] [-c|--chain] [-j|--json]
                                 [--tex] [-o|--output-file FILE] [-s|--single]
                                 [-l|--single-line] [--max-depth INT]
                                 [--max-growth-factor INT] [FILE]
                                 [-d|--dependency-file FILE]

  Rewrite a PHI program.

Available options:
  -r,--rules FILE          FILE with user-defined rules. If unspecified, builtin
                           set of rules is used.
  -c,--chain               Output rewriting steps.
  -j,--json                Output JSON.
  --tex                    Output LaTeX.
  -o,--output-file FILE    Output to FILE. When this option is not specified,
                           output to stdout.
  -s,--single              Output a single expression.
  -l,--single-line         Output a single expression on a single line. Has
                           effect only if the --single is enabled.
  --max-depth INT          Maximum depth of rules application. Defaults to 10.
  --max-growth-factor INT  The factor by which to allow the input term to grow
                           before stopping. Defaults to 10.
  FILE                     FILE to read input from. When no FILE is specified,
                           read from stdin.
  -d,--dependency-file FILE
                           FILE to read dependencies from (zero or more
                           dependency files allowed).
  -h,--help                Show this help text

Here, the FILE stays in the middle of options (why?) and options are not sorted. This is rather confusing. Is -d option really can only be used after the name of the file provided (this is what the format at the top is suggesting).

@yegor256
Copy link
Member Author

@deemp please, check this one

@deemp deemp self-assigned this Dec 13, 2024
@deemp
Copy link
Member

deemp commented Dec 16, 2024

@yegor256, is a message like this OK?

  • The sorting is by the full option name.
  • The --help option is inserted automatically at the end of the list of options. Changing its place is currently nontrivial.
Usage: eo-phi-normalizer rewrite [-c|--chain] [-d|--dependency-file FILE] 
                                 [-j|--json] [--max-depth INT] 
                                 [--max-growth-factor INT] 
                                 [-o|--output-file FILE] [-r|--rules FILE] 
                                 [-s|--single] [-l|--single-line] [--tex] [FILE]

  Rewrite a PHI program.

Available options:
  -c,--chain               Output rewriting steps.
  -d,--dependency-file FILE
                           FILE to read dependencies from (zero or more
                           dependency files allowed).
  -j,--json                Output JSON.
  --max-depth INT          Maximum depth of rules application. Defaults to 10.
  --max-growth-factor INT  The factor by which to allow the input term to grow
                           before stopping. Defaults to 10.
  -o,--output-file FILE    Output to FILE. When this option is not specified,
                           output to stdout.
  -r,--rules FILE          FILE with user-defined rules. If unspecified, builtin
                           set of rules is used.
  -s,--single              Output a single expression.
  -l,--single-line         Output a single expression on a single line. Has
                           effect only if the --single is enabled.
  --tex                    Output LaTeX.
  FILE                     FILE to read input from. When no FILE is specified,
                           read from stdin.
  -h,--help                Show this help text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants