diff --git a/meli/docs/meli.1 b/meli/docs/meli.1 index 3d9bed92..f1898941 100644 --- a/meli/docs/meli.1 +++ b/meli/docs/meli.1 @@ -65,12 +65,6 @@ Create configuration file in .Pa path if given, or at .Pa $XDG_CONFIG_HOME/meli/config.toml -.It Cm edit-config -Edit configuration files with -.Ev EDITOR -or -.Ev VISUAL Ns -\&. .It Cm test-config Op Ar path Test a configuration file for syntax issues or missing options. .It Cm man Op Ar page @@ -81,14 +75,26 @@ Install manual pages to the first location provided by or .Xr manpath 1 , unless you specify the directory as an argument. +.It Cm compiled-with +Print compile time feature flags of this binary. +.It Cm edit-config +Edit configuration files with +.Ev EDITOR +or +.Ev VISUAL Ns +\&. +.It Cm help +Prints help information or the help of the given subcommand(s). +.It Cm print-app-directories +Print all directories that +.Nm Ns + creates and uses. +.It Cm print-config-path +Print location of configuration file that will be loaded on normal app startup. .It Cm print-default-theme Print default theme keys and values in TOML syntax, to be used as a blueprint. .It Cm print-loaded-themes Print all loaded themes in TOML syntax. -.It Cm print-used-paths -Print all paths that are created and used. -.It Cm compiled-with -Print compile time feature flags of this binary. .It Cm view View mail from input file. .El diff --git a/meli/src/args.rs b/meli/src/args.rs index 67f8e467..cc11a774 100644 --- a/meli/src/args.rs +++ b/meli/src/args.rs @@ -40,8 +40,11 @@ pub enum SubCommand { PrintDefaultTheme, /// print loaded themes in full to stdout and exit. PrintLoadedThemes, - /// print all paths that meli creates/uses. - PrintUsedPaths, + /// print all directories that meli creates/uses. + PrintAppDirectories, + /// print location of configuration file that will be loaded on normal app + /// startup. + PrintConfigPath, /// edit configuration files with `$EDITOR`/`$VISUAL`. EditConfig, /// create a sample configuration file with available configuration options. diff --git a/meli/src/main.rs b/meli/src/main.rs index 7b7514d5..3ae5f147 100644 --- a/meli/src/main.rs +++ b/meli/src/main.rs @@ -101,6 +101,11 @@ fn run_app(opt: Opt) -> Result<()> { Some(SubCommand::EditConfig) => { return subcommands::edit_config(); } + Some(SubCommand::PrintConfigPath) => { + let config_path = crate::conf::get_config_file()?; + println!("{}", config_path.display()); + return Ok(()); + } #[cfg(not(feature = "cli-docs"))] Some(SubCommand::Man(ManOpt {})) => { return Err(Error::new("error: this version of meli was not build with embedded documentation (cargo feature `cli-docs`). You might have it installed as manpages (eg `man meli`), otherwise check https://meli-email.org")); @@ -122,7 +127,7 @@ fn run_app(opt: Opt) -> Result<()> { return Ok(()); } Some(SubCommand::View { .. }) => {} - Some(SubCommand::PrintUsedPaths) => { + Some(SubCommand::PrintAppDirectories) => { println!( "{}", xdg::BaseDirectories::with_prefix("meli")