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

Include list of exit codes in generated documentation #56

Open
ap0llo opened this issue Jun 15, 2020 · 0 comments
Open

Include list of exit codes in generated documentation #56

ap0llo opened this issue Jun 15, 2020 · 0 comments
Labels
area-commandlinehelp feature New feature or request

Comments

@ap0llo
Copy link
Owner

ap0llo commented Jun 15, 2020

For commandline applications, the exit code is used to communicate errors. Some applications might use more detailed exit codes than 0 for success and 1 for error.

If different error codes are used to signal different results (e.g. different kinds or errors, warnings etc), it would be useful if the generated commandline help would list the exit codes and their meaning.

To get the list of possible exit codes, the option classes would have to be annotated with additioal attributes. Because the attribute is not included in the CommandLineParser package, it would need to ship as a MdDocs.* package (possibly as source package to avoid adding having to ship the annotations with the application.

The annotation could look something like this:

[Verb("command")]
[ExitCode(0, "The command completed successfully")]
[ExitCode(1, "The command completed with warnings")]
[ExitCode(2, "Invalid arguments")]
[ExitCode(3, "Unspecified error")]
class MyCommandOptions
{
    //...
}

For multi-command applications, the exit codes should be listed for every command as well as on the application main page (all exit codes of all commands)

@ap0llo ap0llo added feature New feature or request area-commandlinehelp labels Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commandlinehelp feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant