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

whatif #2454

Open
KathleenDollard opened this issue Jul 16, 2024 · 1 comment
Open

whatif #2454

KathleenDollard opened this issue Jul 16, 2024 · 1 comment
Labels
Powderhouse Work to isolate parser and features

Comments

@KathleenDollard
Copy link
Contributor

Consider an optional subsystem in the Invocation phase that allows a standard whatif mechanism.

  • A default option, similar to the help option added during the initialization step
  • Annotations (instance, not annotations) that provide
    • Delegate for custom output
  • A default implementation that on syntactic (core parser) errors:
    • Displays errors and no further information
  • The default implementation on core parser success:
    • Lists the command with its parent commands
    • Outputs options and arguments with the parsed values
    • Displays all output to that point
    • Displays all validation errors
  • Displays output is via a text writer, so that future enhancement to provide JSON output is accommodated

The expected usage is to replace diagramming where a simple understanding and confirmation of the parse result is needed. This can be important to CLI users and CLI authors. It may also be useful in tests, which is why a machine friendly output like JSON may be helpful.

Diagramming is still important to understand nuances of why parsing fails when it does not work as expected.

Proposed sample output:

ApplicationName.exe

Command: 
   Grandparent parent command

Arguments:
   Arg1: arg1 value
   Arg2: arg2 value

Options:
   Option1: value
   Option2: 41             Error: 41 is not the correct value

This subsystem could either be part of the standard Powderhouse subsystems or a separate package.

@KathleenDollard KathleenDollard added the Powderhouse Work to isolate parser and features label Jul 16, 2024
@Balkoth
Copy link

Balkoth commented Jul 17, 2024

Whatif there finally was a release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Powderhouse Work to isolate parser and features
Projects
None yet
Development

No branches or pull requests

2 participants