Skip to content

Do not print the entire help when option processing fails. #5176

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

Open
fruffy opened this issue Mar 14, 2025 · 2 comments · May be fixed by #5223
Open

Do not print the entire help when option processing fails. #5176

fruffy opened this issue Mar 14, 2025 · 2 comments · May be fixed by #5223
Labels
core Topics concerning the core segments of the compiler (frontend, midend, parser)

Comments

@fruffy
Copy link
Collaborator

fruffy commented Mar 14, 2025

Instead, maybe just provide a hint that the --help option is available?

Originally posted by @ChrisDodd in #5175 (review)

@AkarshSahlot
Copy link
Contributor

@fruffy I'm investigating #5176 (shortening help output on errors) and found that:
The Python entry point at tools/driver/p4c_src/driver.py handles some command-line processing
Could you confirm:

  • Which file is the primary place to modify the help message behavior?
  • Should changes be made in this location?

(I notice driver.py uses Python's argparse while - I want to make sure I modify the right one)

@kfcripps
Copy link
Contributor

kfcripps commented Apr 2, 2025

@AkarshSahlot It is in https://github.com/p4lang/p4c/blob/main/lib/options.cpp (search for usage()).

AkarshSahlot added a commit to AkarshSahlot/p4c that referenced this issue Apr 6, 2025
@AkarshSahlot AkarshSahlot linked a pull request Apr 6, 2025 that will close this issue
@kfcripps kfcripps added the core Topics concerning the core segments of the compiler (frontend, midend, parser) label May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Topics concerning the core segments of the compiler (frontend, midend, parser)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants