diff --git a/README.md b/README.md index 7ddfeaa..c82cffd 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ urls and headers saved to a file for easy reuse at a later point. If you have web services in different environments, you might for example want to have a `foo-dev` and `foo-prod` configuration file. This makes it easy to at -a later date connect to `foo` by simply running `wsta -p foo-dev`, +a later date connect to `foo` by simply running `wsta -P foo-dev`, These files could be checked into VCS and shared between colleagues. diff --git a/src/args.rs b/src/args.rs index c5d0769..0ac43e8 100644 --- a/src/args.rs +++ b/src/args.rs @@ -6,13 +6,11 @@ use std::env; /// invoked (to init options). /// This method is not perfect - it would be hard to support /// both `--profile test` and `--profile=test`, for example, so -/// we keep it simple and only support -p +/// we keep it simple and only support -P pub fn get_profile() -> Option { - // Find the position of -p - let pos = env::args().position(|a| { - a == "-p" - }); + // Find the position of -P + let pos = env::args().position(|a| a == "-P"); // Get the next arg as the value if pos.is_some() { diff --git a/src/conf.rs b/src/conf.rs index b12b537..3b4ddbf 100644 --- a/src/conf.rs +++ b/src/conf.rs @@ -106,7 +106,7 @@ pub fn get_vec(config: &Config, key: &str) -> Vec { /// Determine the conf file location using the special %APPDATA% directory of /// windows. /// -/// Supports profiles, i.e. `-p someapp` resolves to +/// Supports profiles, i.e. `-P someapp` resolves to /// %APPDATA%/wsta/someapp/wsta.conf #[cfg(windows)] fn get_config_path(profile: Option) -> Option { @@ -125,7 +125,7 @@ fn get_config_path(profile: Option) -> Option { /// Determine the conf file location using the XDG basedir spec, which defaults /// to $HOME/.config/wsta/wsta.conf /// -/// Supports profiles, i.e. `-p someapp` resolves to +/// Supports profiles, i.e. `-P someapp` resolves to /// XDG_CONF_DIR/wsta/someapp/wsta.conf #[cfg(unix)] fn get_config_path(profile: Option) -> Option { diff --git a/src/main.rs b/src/main.rs index ddef5c5..33730cf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -120,7 +120,7 @@ fn main() { // before ArgumentParser is invoked ap.refer(&mut dummy) .metavar("NAME") - .add_option(&["-p"], Store, + .add_option(&["-P"], Store, "use a different configuration profile"); ap.refer(&mut options.verbosity) diff --git a/wsta.1 b/wsta.1 index bda39e6..134c7c5 100644 --- a/wsta.1 +++ b/wsta.1 @@ -145,7 +145,7 @@ will honour any redirects the server requests. config key: follow_redirect (Boolean) .TP -.B \-p NAME +.B \-P NAME Tell .B wsta to use a configuration profile for this connection only. The name of the profile @@ -154,7 +154,7 @@ is the name of the folder in where the file that is to be loaded is located. If you want a profile to be used without -.B \-p, +.B \-P, use the file .I $XDG_CONFIG_HOME/wsta/wsta.conf. @@ -256,7 +256,7 @@ Any profiles are simply fonders inside the config directory. Any files names .B wsta.conf placed in the config directory can later be loaded using -.B \-p . +.B \-P . .SH AUTHOR diff --git a/wsta.md b/wsta.md index 8ed66ea..e4467bf 100644 --- a/wsta.md +++ b/wsta.md @@ -118,13 +118,13 @@ wsta(1) General Commands Manual wsta(1) config key: follow_redirect (Boolean) - -p NAME + -P NAME Tell wsta to use a configuration profile for this connection only. The name of the profile is the name of the folder in $XDG_CONFIG_HOME/wsta where the file that is to be loaded is located. - If you want a profile to be used without -p, use the file + If you want a profile to be used without -P, use the file $XDG_CONFIG_HOME/wsta/wsta.conf. Also see the FILES section. @@ -206,7 +206,7 @@ wsta(1) General Commands Manual wsta(1) $XDG_CONFIG_HOME/wsta//wsta.conf Any profiles are simply fonders inside the wsta config direc- tory. Any files names wsta.conf placed in the config directory - can later be loaded using -p . + can later be loaded using -P .