Merge pull request #71 from joelakuhn/force-blocks-flag

Add --blocks flag to force block output
This commit is contained in:
Atanas Yankov 2021-04-29 21:04:16 +03:00 committed by GitHub
commit 8a2324a94c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -110,6 +110,7 @@ USAGE:
When FILE is -, read standard input.
FLAGS:
-b, --blocks Force block output
-m, --mirror Display a mirror of the original image
-n, --name Output the name of the file before displaying
-1, --once Only loop once through the animation

View file

@ -37,11 +37,17 @@ impl<'a> Config<'a> {
let transparent = matches.is_present("transparent");
let use_blocks = matches.is_present("blocks");
let viuer_config = ViuerConfig {
transparent,
width,
height,
absolute_offset: false,
use_kitty: !use_blocks,
use_iterm: !use_blocks,
#[cfg(feature = "sixel")]
sixel: !use_blocks,
..Default::default()
};

View file

@ -78,6 +78,13 @@ fn main() {
.takes_value(true)
.help("Play gif at the given frame rate"),
)
.arg(
Arg::with_name("blocks")
.short("b")
.long("blocks")
.takes_value(false)
.help("Force block output"),
)
.get_matches();
let conf = Config::new(&matches);