mirror of
https://github.com/atanunq/viu
synced 2024-10-18 13:02:18 +00:00
Merge pull request #71 from joelakuhn/force-blocks-flag
Add --blocks flag to force block output
This commit is contained in:
commit
8a2324a94c
|
@ -110,6 +110,7 @@ USAGE:
|
||||||
When FILE is -, read standard input.
|
When FILE is -, read standard input.
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
|
-b, --blocks Force block output
|
||||||
-m, --mirror Display a mirror of the original image
|
-m, --mirror Display a mirror of the original image
|
||||||
-n, --name Output the name of the file before displaying
|
-n, --name Output the name of the file before displaying
|
||||||
-1, --once Only loop once through the animation
|
-1, --once Only loop once through the animation
|
||||||
|
|
|
@ -37,11 +37,17 @@ impl<'a> Config<'a> {
|
||||||
|
|
||||||
let transparent = matches.is_present("transparent");
|
let transparent = matches.is_present("transparent");
|
||||||
|
|
||||||
|
let use_blocks = matches.is_present("blocks");
|
||||||
|
|
||||||
let viuer_config = ViuerConfig {
|
let viuer_config = ViuerConfig {
|
||||||
transparent,
|
transparent,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
absolute_offset: false,
|
absolute_offset: false,
|
||||||
|
use_kitty: !use_blocks,
|
||||||
|
use_iterm: !use_blocks,
|
||||||
|
#[cfg(feature = "sixel")]
|
||||||
|
sixel: !use_blocks,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,13 @@ fn main() {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("Play gif at the given frame rate"),
|
.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();
|
.get_matches();
|
||||||
|
|
||||||
let conf = Config::new(&matches);
|
let conf = Config::new(&matches);
|
||||||
|
|
Loading…
Reference in a new issue