mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:31 +00:00
1 parent
c7e2235293
commit
70fa092df1
2 files changed
+16
-6
No files matched your search
@@ -1,3 +1,14 @@
|
|||||||
|
# unreleased
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Only show one panel by default if the terminal width is not wide enough for two panels, see #182 (@sharkdp)
|
||||||
|
|
||||||
|
## Bugfixes
|
||||||
|
|
||||||
|
- Do not fail with an error if `--panels=auto` is used and the output is piped, see #184 (@sharkdp)
|
||||||
|
|
||||||
|
|
||||||
# v0.11.0
|
# v0.11.0
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|||||||
+5
-6
@@ -163,7 +163,8 @@ fn run() -> Result<()> {
|
|||||||
.help(
|
.help(
|
||||||
"Sets the number of hex data panels to be displayed. \
|
"Sets the number of hex data panels to be displayed. \
|
||||||
`--panels=auto` will display the maximum number of hex data panels \
|
`--panels=auto` will display the maximum number of hex data panels \
|
||||||
based on the current terminal width",
|
based on the current terminal width. By default, hexyl will show \
|
||||||
|
two panels, unless the terminal is not wide enough for that.",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
@@ -389,12 +390,10 @@ fn run() -> Result<()> {
|
|||||||
1
|
1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let terminal_width = terminal_size().map(|s| s.0 .0 as u64).unwrap_or(80);
|
||||||
|
|
||||||
let panels = if matches.get_one::<String>("panels").map(String::as_ref) == Some("auto") {
|
let panels = if matches.get_one::<String>("panels").map(String::as_ref) == Some("auto") {
|
||||||
max_panels_fn(
|
max_panels_fn(terminal_width, base_digits, group_bytes.into())
|
||||||
terminal_size().ok_or_else(|| anyhow!("not a TTY"))?.0 .0 as u64,
|
|
||||||
base_digits,
|
|
||||||
group_bytes.into(),
|
|
||||||
)
|
|
||||||
} else if let Some(panels) = matches
|
} else if let Some(panels) = matches
|
||||||
.get_one::<String>("panels")
|
.get_one::<String>("panels")
|
||||||
.map(|s| {
|
.map(|s| {
|
||||||
|
|||||||
Reference in new issue
Block a user