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

Improvement: Cleanup the command-line interface. #258

Merged
merged 13 commits into from
Aug 9, 2023

Conversation

DaveMcEwan
Copy link
Contributor

  • Rename options to make the whole interface consistent and intuitive for new users.
    • --example -> --config-example
    • --update -> --config-update
    • Backwards compatibility maintained with aliases.
  • Rename options to be consistent with other tools (GCC, Clang, Verilator, etc.).
    • -i/--include -> -I/incdir (also consistent with filelist plusarg/keyword)
    • -d -> -D
    • Backwards compatibility maintained with aliases.
  • Remove unnecessary choice --dump-filelist=no.
    Technically a breaking change, but I doubt it is ever used in practice.
  • Add long format for every option.
    • -E + --preprocess-only
    • -1 + --oneline (consistent with Git)
  • Add new option --shell-completion to print shell completion scripts to STDOUT.
  • Add tests for all options, to detect backwards compatibility regressions in the future.
  • Rephrase help messages so they're all consistent with each other.
  • Renamed internal variables to match option names, just for code clarity.

DaveMcEwan and others added 13 commits June 27, 2023 15:00
…-update`

- Provide users with better hint about what the options do.
- Note that example is printed, but update is performed in-place.
- Maintain backwards compatibility with aliases `--example` and `--update`.
- I/D are common to other compilers (gcc, clang, verilator, yosys/read_verilog)
- Maintain backwards compatibility with short aliases.
- Rename internal `single` -> `oneline` to match.
  Personally, I think it's more descriptive too.
- `-1` can be difficult to distinguish from `-l` in some fonts.
- Use the same name "oneline" as `git log` which has similar behaviour.
- Slightly more descriptive.
- Matches other tools which call them "incdirs".
- Matches keyword "+incdir+" used in filelists.
- Use alias for backward compatibility.
`Option<DumpFilelistMode>` instead of `DumpFilelistMode`
- More consistent with --config-example.
- Other --dump-* options produce something useful for debug, but this is not.
- Including the word "shell" provides a better hint to users.
- Clarification for readers of the code.
- Changes clap's help message to be consistent with `--defines` and `--incdirs`.
@DaveMcEwan DaveMcEwan marked this pull request as ready for review June 30, 2023 17:01
@DaveMcEwan DaveMcEwan changed the title Feature: Cleanup the command-line interface. Improvement: Cleanup the command-line interface. Jul 10, 2023
@dalance dalance merged commit 4bf1aa6 into dalance:master Aug 9, 2023
@DaveMcEwan DaveMcEwan deleted the cli branch August 23, 2023 08:45
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

Successfully merging this pull request may close these issues.

[feature] Shell completions
2 participants