Compare commits

...

2 Commits

3 changed files with 33 additions and 8 deletions
+21 -7
View File
@@ -259,6 +259,8 @@ Commands:
lidarr Commands for manging your Lidarr instance lidarr Commands for manging your Lidarr instance
completions Generate shell completions for the Managarr CLI completions Generate shell completions for the Managarr CLI
tail-logs Tail Managarr logs tail-logs Tail Managarr logs
config-path Print the full path to the default configuration file.
This file can be changed to another location using the '--config-file' flag
help Print this message or the help of the given subcommand(s) help Print this message or the help of the given subcommand(s)
Options: Options:
@@ -266,14 +268,23 @@ Options:
-V, --version Print version -V, --version Print version
Global Options: Global Options:
--disable-spinner Disable the spinner (can sometimes make parsing output challenging) [env: MANAGARR_DISABLE_SPINNER=] --disable-spinner Disable the spinner (can sometimes make parsing output
--config-file <CONFIG_FILE> The Managarr configuration file to use [env: MANAGARR_CONFIG_FILE=] challenging) [env: MANAGARR_DISABLE_SPINNER=]
--themes-file <THEMES_FILE> The Managarr themes file to use [env: MANAGARR_THEMES_FILE=] --config-file <CONFIG_FILE> The Managarr configuration file to use; defaults to the
--theme <THEME> The name of the Managarr theme to use [env: MANAGARR_THEME=] path shown by 'managarr config-path' [env:
--servarr-name <SERVARR_NAME> For multi-instance configurations, you need to specify the name of the instance configuration that you want to use. MANAGARR_CONFIG_FILE=]
--themes-file <THEMES_FILE> The Managarr themes file to use [env:
MANAGARR_THEMES_FILE=]
--theme <THEME> The name of the Managarr theme to use [env:
MANAGARR_THEME=]
--servarr-name <SERVARR_NAME> For multi-instance configurations, you need to specify
the name of the instance configuration that you want to
use.
This is useful when you have multiple instances of the same Servarr defined in your config file. This is useful when you have multiple instances of the
By default, if left empty, the first configured Servarr instance listed in the config file will be used. same Servarr defined in your config file.
By default, if left empty, the first configured Servarr
instance listed in the config file will be used.
``` ```
All subcommands also have detailed help menus to show you how to use them. For example, to see all available commands for Sonarr, you would run: All subcommands also have detailed help menus to show you how to use them. For example, to see all available commands for Sonarr, you would run:
@@ -332,6 +343,9 @@ but all servers will require you to input the API token.
The configuration file is located somewhere different for each OS. The configuration file is located somewhere different for each OS.
You can use `managarr config-path` to locate the default configuration file for your system. In general, the default
config file paths for each system is listed below:
### Linux ### Linux
``` ```
$HOME/.config/managarr/config.yml $HOME/.config/managarr/config.yml
+7
View File
@@ -3,6 +3,7 @@ use std::sync::Arc;
use anyhow::Result; use anyhow::Result;
use clap::{Subcommand, command}; use clap::{Subcommand, command};
use clap_complete::Shell; use clap_complete::Shell;
use indoc::indoc;
use lidarr::{LidarrCliHandler, LidarrCommand}; use lidarr::{LidarrCliHandler, LidarrCommand};
use radarr::{RadarrCliHandler, RadarrCommand}; use radarr::{RadarrCliHandler, RadarrCommand};
use sonarr::{SonarrCliHandler, SonarrCommand}; use sonarr::{SonarrCliHandler, SonarrCommand};
@@ -43,6 +44,12 @@ pub enum Command {
#[arg(long, help = "Disable colored log output")] #[arg(long, help = "Disable colored log output")]
no_color: bool, no_color: bool,
}, },
#[command(about = indoc!{"
Print the full path to the default configuration file.
This file can be changed to another location using the '--config-file' flag
"})]
ConfigPath,
} }
pub trait CliCommandHandler<'a, 'b, T: Into<Command>> { pub trait CliCommandHandler<'a, 'b, T: Into<Command>> {
+5 -1
View File
@@ -86,7 +86,7 @@ struct GlobalOpts {
global = true, global = true,
value_parser, value_parser,
env = "MANAGARR_CONFIG_FILE", env = "MANAGARR_CONFIG_FILE",
help = "The Managarr configuration file to use" help = "The Managarr configuration file to use; defaults to the path shown by 'managarr config-path'"
)] )]
config_file: Option<PathBuf>, config_file: Option<PathBuf>,
#[arg( #[arg(
@@ -170,6 +170,10 @@ async fn main() -> Result<()> {
generate(shell, &mut cli, "managarr", &mut io::stdout()) generate(shell, &mut cli, "managarr", &mut io::stdout())
} }
Command::TailLogs { no_color } => tail_logs(no_color).await?, Command::TailLogs { no_color } => tail_logs(no_color).await?,
Command::ConfigPath => println!(
"{}",
confy::get_configuration_file_path("managarr", "config")?.display()
),
}, },
None => { None => {
let app_nw = Arc::clone(&app); let app_nw = Arc::clone(&app);