From 1df7c01cb0b16acfb9aa7a609c113b307e5019f3 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Sat, 7 Jan 2023 11:35:50 +0100 Subject: [PATCH] Expose --ansi flag --- CHANGELOG.md | 1 + mdcat.1.adoc | 3 +++ src/bin/mdcat/args.rs | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0d23dc1..5643f0ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ To publish a new release run `scripts/release` from the project directory. ### Added - Add `--detect-terminal` to print the name of the detected terminal program (see [GH-232]). +- Add `--ansi` to skip terminal detection and use ANSI-formatting only (see [GH-232]). ### Changed diff --git a/mdcat.1.adoc b/mdcat.1.adoc index 0c804db3..c4f55b0a 100644 --- a/mdcat.1.adoc +++ b/mdcat.1.adoc @@ -90,6 +90,9 @@ This is the default when run as `mdcat`. --no-colour:: Disable all colours and other styles. +--ansi:: + Skip terminal detection and only use ANSI formatting. + --columns:: Maximum number of columns to use for text output. Defaults to the size of the underlying terminal. diff --git a/src/bin/mdcat/args.rs b/src/bin/mdcat/args.rs index 24836b99..f8a3f5b1 100644 --- a/src/bin/mdcat/args.rs +++ b/src/bin/mdcat/args.rs @@ -101,7 +101,7 @@ pub struct CommonArgs { /// Print detected terminal name and exit. #[arg(long = "detect-terminal")] pub detect_and_exit: bool, - /// Limit to standard ANSI formatting. - #[arg(long, conflicts_with = "no_colour", hide = true)] + /// Skip terminal detection and only use ANSI formatting. + #[arg(long = "ansi", conflicts_with = "no_colour")] pub ansi_only: bool, }