diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2018-11-16 11:05:02 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2018-11-16 12:01:00 +0100 |
| commit | 296a8b7e83a9b174ca7e42a46cf02315c4e2c826 (patch) | |
| tree | ce0d75b0d6850f3ceb75b4ca354df1354ecd5fc7 /mullvad-daemon/src | |
| parent | 75ebb64fbea39a4f11e698b5cb5d8ca52a2f4908 (diff) | |
| download | mullvadvpn-296a8b7e83a9b174ca7e42a46cf02315c4e2c826.tar.xz mullvadvpn-296a8b7e83a9b174ca7e42a46cf02315c4e2c826.zip | |
Print MULLVAD_ path variable defaults in help text
Diffstat (limited to 'mullvad-daemon/src')
| -rw-r--r-- | mullvad-daemon/src/cli.rs | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/mullvad-daemon/src/cli.rs b/mullvad-daemon/src/cli.rs index 42f7ca9c2e..0fe85588fe 100644 --- a/mullvad-daemon/src/cli.rs +++ b/mullvad-daemon/src/cli.rs @@ -35,21 +35,31 @@ pub fn get_config() -> Config { } } -fn create_app() -> App<'static, 'static> { - let app = App::new(crate_name!()) - .version(version::PRODUCT_VERSION) - .author(crate_authors!(", ")) - .about(crate_description!()) - .after_help( +lazy_static::lazy_static! { + static ref ENV_DESC: String = format!( "ENV: MULLVAD_RESOURCE_DIR Resource directory (i.e used to locate a root CA certificate) - MULLVAD_SETTINGS_DIR Directory path for storing settings - MULLVAD_CACHE_DIR Directory path for storing cache + [Default: {}] + MULLVAD_SETTINGS_DIR Directory path for storing settings. [Default: {}] + MULLVAD_CACHE_DIR Directory path for storing cache. [Default: {}] MULLVAD_RPC_SOCKET_PATH Location of the management interface device. - It refers to Unix domain socket on Unix based platforms, and named pipe on Windows + It refers to Unix domain socket on Unix based platforms, and named pipe on Windows. + [Default: {}] + +", + mullvad_paths::get_default_resource_dir().display(), + mullvad_paths::get_default_settings_dir().expect("Unable to get settings dir").display(), + mullvad_paths::get_default_cache_dir().expect("Unable to get cache dir").display(), + mullvad_paths::get_default_rpc_socket_path().display()); +} -") +fn create_app() -> App<'static, 'static> { + let app = App::new(crate_name!()) + .version(version::PRODUCT_VERSION) + .author(crate_authors!(", ")) + .about(crate_description!()) + .after_help(ENV_DESC.as_str()) .arg( Arg::with_name("v") .short("v") |
