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

Add cargo-style output diagnostics. #859

Merged
merged 1 commit into from
Jun 27, 2022
Merged

Commits on Jun 27, 2022

  1. Add cargo-style output diagnostics.

    Adds the quiet and color command-line flags, where color supports `auto`, always`, and `never`. These command-line flags are parsed to a verbosity which can be quiet, normal, or verbose.
    
    With these, we then have the stderr message formatters:
    - `fatal_usage`: print a fatal error message with the failing argument, and add a help context menu for how to use cross.
    - `fatal`: print red 'error' message and exit with an error code
    - `error`: print red 'error' message
    - `warn`: print amber 'warning' message
    - `note`: print cyan 'note' message
    - `status`: print an uncolored and unprefixed 'status' message
    
    We have the stdout message formatters:
    - `print`: always print the message
    - `info`: print the message as long as the verbosity is not quiet
    - `debug`: only print the message if the output is not quiet
    
    We also have a few specialized error handlers, and methods to help ensure we can have flexible error reporting in the future:
    - `status_stderr`
    - `status_stdout`
    
    The command extensions now have, `print`, `info`, and `debug`, which formats the command and sends it to the shell. This allows us to avoid using `print_verbose` where we sometimes manually override the default setting.
    
    Closes cross-rs#797.
    Alexhuszagh committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    eef20f9 View commit details
    Browse the repository at this point in the history