cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.25k stars 1.1k forks source link

Remove Markdown code from the long CLI help #247

Closed palant closed 1 month ago

palant commented 1 month ago

As mentioned in https://github.com/cloudflare/pingora/issues/231#issuecomment-2130246506, the issue hasn’t been entirely addressed. Clap has a short and a long help variants. While the former has been made proper, the latter still contains doc comments with Markdown code and such.

This change resets the long help, effectively making clap show the short help variant for both -h and --help command line flags. Also fixing the grammar for the --daemon flag description while at it.

$ cargo run --example gateway -- --help
basic 
Command-line options

USAGE:
    gateway [OPTIONS]

OPTIONS:
    -c, --conf <CONF>    The path to the configuration file.
    -d, --daemon         Whether this server should run in the background
    -h, --help           Print help information
    -t, --test           This flag is useful for upgrading service where the user wants to make sure
                         the new service can start before shutting down the old server process.
    -u, --upgrade        This is the base set of command line arguments for a pingora-based service
drcaramelsyrup commented 1 month ago

Merged in https://github.com/cloudflare/pingora/commit/b7ac8a50fc3b6bf7d1ed0aafdd03235260e8a3e0. Thanks for your diligence here!