From 0c93a4cfe9c51422170c18c5ea4b22f2d069cccd Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sat, 1 Oct 2022 23:52:03 +0200 Subject: [PATCH 1/3] Remove deprecated --config-path command --- docs/src/usage.txt | 1 - src/cli.rs | 4 ---- src/main.rs | 22 ---------------------- 3 files changed, 27 deletions(-) diff --git a/docs/src/usage.txt b/docs/src/usage.txt index fdc0c9f..f6b159d 100644 --- a/docs/src/usage.txt +++ b/docs/src/usage.txt @@ -21,7 +21,6 @@ OPTIONS: -r, --raw Display the raw markdown instead of rendering it -q, --quiet Suppress informational messages --show-paths Show file and directory paths used by tealdeer - --config-path Show config file path --seed-config Create a basic config --color Control whether to use color [possible values: always, auto, never] -v, --version Print the version diff --git a/src/cli.rs b/src/cli.rs index a35df31..2108a1d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -93,10 +93,6 @@ pub(crate) struct Args { #[clap(long = "show-paths")] pub show_paths: bool, - /// Show config file path - #[clap(long = "config-path")] - pub config_path: bool, - /// Create a basic config #[clap(long = "seed-config")] pub seed_config: bool, diff --git a/src/main.rs b/src/main.rs index ffacae2..156eba6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -140,19 +140,6 @@ fn update_cache(cache: &Cache, quietly: bool, enable_styles: bool) { } } -/// Show the config path (DEPRECATED) -fn show_config_path(enable_styles: bool) { - match get_config_path() { - Ok((config_file_path, _)) => { - println!("Config path is: {}", config_file_path.to_str().unwrap()); - } - Err(e) => { - print_error(enable_styles, &e.context("Could not look up config path")); - process::exit(1); - } - } -} - /// Show file paths fn show_paths(config: &Config) { let config_dir = get_config_dir().map_or_else( @@ -290,15 +277,6 @@ fn main() { } args.platform = args.platform.or(args.os); - // Show config file and path, pass through - if args.config_path { - print_warning( - enable_styles, - "The --config-path flag is deprecated, use --show-paths instead", - ); - show_config_path(enable_styles); - } - // Look up config file, if none is found fall back to default config. let config = match Config::load(enable_styles) { Ok(config) => config, From efe1b5769638e96fcb02b9cbef70ccdd20a04d30 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sat, 1 Oct 2022 23:53:28 +0200 Subject: [PATCH 2/3] Remove deprecated -o/--os command --- src/cli.rs | 9 --------- src/main.rs | 7 ------- 2 files changed, 16 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 2108a1d..5c8e238 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -43,15 +43,6 @@ pub(crate) struct Args { )] pub platform: Option, - /// Deprecated alias of `platform` - #[clap( - short = 'o', - long = "os", - possible_values = ["linux", "macos", "windows", "sunos", "osx"], - hide = true - )] - pub os: Option, - /// Override the language #[clap(short = 'L', long = "language")] pub language: Option, diff --git a/src/main.rs b/src/main.rs index 156eba6..f4a4687 100644 --- a/src/main.rs +++ b/src/main.rs @@ -269,13 +269,6 @@ fn main() { "The -m / --markdown flag is deprecated, use -r / --raw instead", ); } - if args.os.is_some() { - print_warning( - enable_styles, - "The -o / --os flag is deprecated, use -p / --platform instead", - ); - } - args.platform = args.platform.or(args.os); // Look up config file, if none is found fall back to default config. let config = match Config::load(enable_styles) { From 2ebf86b265f1cc6f24e649f938056ff4afdfc661 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sat, 1 Oct 2022 23:54:37 +0200 Subject: [PATCH 3/3] Remove deprecated -m/--markdown command --- src/cli.rs | 9 --------- src/main.rs | 11 +---------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 5c8e238..8646cac 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -67,15 +67,6 @@ pub(crate) struct Args { #[clap(short = 'r', long = "--raw", requires = "command_or_file")] pub raw: bool, - /// Deprecated alias of `raw` - #[clap( - long = "markdown", - short = 'm', - requires = "command_or_file", - hide = true - )] - pub markdown: bool, - /// Suppress informational messages #[clap(short = 'q', long = "quiet")] pub quiet: bool, diff --git a/src/main.rs b/src/main.rs index f4a4687..8f601e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -240,7 +240,7 @@ fn main() { init_log(); // Parse arguments - let mut args = Args::parse(); + let args = Args::parse(); // Determine the usage of styles #[cfg(target_os = "windows")] @@ -261,15 +261,6 @@ fn main() { ColorOptions::Never => false, }; - // Handle renamed arguments - if args.markdown { - args.raw = true; - print_warning( - enable_styles, - "The -m / --markdown flag is deprecated, use -r / --raw instead", - ); - } - // Look up config file, if none is found fall back to default config. let config = match Config::load(enable_styles) { Ok(config) => config,