Skip to content

Commit

Permalink
Improve --help text.
Browse files Browse the repository at this point in the history
All of the options and subcommands now have one-line descriptions,
and the after_help text gives a basic explanation of how to set up
silver as well as referring to the wiki.
  • Loading branch information
zackw committed Nov 24, 2020
1 parent bc3cffb commit 6c32e5b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ pub use structopt::StructOpt;
#[structopt(
about = "a cross-shell customizable powerline-like prompt with icons",
name = "silver",
after_help = "https://github.com/reujab/silver/wiki"
after_help =
r#"To use silver, put `eval $(silver init)` or equivalent in your shell's
interactive startup file. The `lprint` and `rprint` subcommands are
used by the code emitted by `silver init`; you should not need to use
them directly.
silver expects a configuration file in $XDG_CONFIG_HOME/silver/config.toml
on Unix, or {FOLDERID_RoamingAppData}/silver/config/config.toml on Windows.
(This path can be overridden with the --config option.)
See <https://github.com/reujab/silver/wiki> for documentation of this file.
"#
)]
pub struct Silver {
/// Path of the configuration file to use.
#[structopt(short, long)]
pub config: Option<String>,
/// Name of your shell (e.g. bash).
#[structopt(short, long)]
pub shell: Option<String>,
#[structopt(subcommand)]
Expand All @@ -17,7 +29,10 @@ pub struct Silver {

#[derive(StructOpt, Debug)]
pub enum Command {
/// Emit shell code to set up silver.
Init,
/// Print the left side of a prompt.
Lprint,
/// Print the right side of a prompt.
Rprint,
}

0 comments on commit 6c32e5b

Please sign in to comment.