Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Expose --ansi flag
Browse files Browse the repository at this point in the history
  • Loading branch information
swsnr committed Jan 7, 2023
1 parent 1760707 commit 1df7c01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions mdcat.1.adoc
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/bin/mdcat/args.rs
Expand Up @@ -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,
}

0 comments on commit 1df7c01

Please sign in to comment.