mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-03 01:50:12 +00:00
feat(cli): add a --ui-scale
[0,100] cli parameter (#492)
This commit is contained in:
parent
64c599ef10
commit
f887a2390e
21
man/tv.1
21
man/tv.1
@ -1,10 +1,10 @@
|
|||||||
.ie \n(.g .ds Aq \(aq
|
.ie \n(.g .ds Aq \(aq
|
||||||
.el .ds Aq '
|
.el .ds Aq '
|
||||||
.TH television 1 "television 0.11.8"
|
.TH television 1 "television 0.11.9"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
television \- A cross\-platform, fast and extensible general purpose fuzzy finder TUI.
|
television \- A cross\-platform, fast and extensible general purpose fuzzy finder TUI.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fBtelevision\fR [\fB\-p\fR|\fB\-\-preview\fR] [\fB\-\-no\-preview\fR] [\fB\-\-delimiter\fR] [\fB\-t\fR|\fB\-\-tick\-rate\fR] [\fB\-f\fR|\fB\-\-frame\-rate\fR] [\fB\-k\fR|\fB\-\-keybindings\fR] [\fB\-i\fR|\fB\-\-input\fR] [\fB\-\-custom\-header\fR] [\fB\-\-autocomplete\-prompt\fR] [\fB\-\-select\-1\fR] [\fB\-\-no\-remote\fR] [\fB\-\-no\-help\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fICHANNEL\fR] [\fIPATH\fR] [\fIsubcommands\fR]
|
\fBtelevision\fR [\fB\-p\fR|\fB\-\-preview\fR] [\fB\-\-no\-preview\fR] [\fB\-\-delimiter\fR] [\fB\-t\fR|\fB\-\-tick\-rate\fR] [\fB\-f\fR|\fB\-\-frame\-rate\fR] [\fB\-k\fR|\fB\-\-keybindings\fR] [\fB\-i\fR|\fB\-\-input\fR] [\fB\-\-custom\-header\fR] [\fB\-\-autocomplete\-prompt\fR] [\fB\-\-exact\fR] [\fB\-\-select\-1\fR] [\fB\-\-no\-remote\fR] [\fB\-\-no\-help\fR] [\fB\-\-ui\-scale\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fICHANNEL\fR] [\fIPATH\fR] [\fIsubcommands\fR]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
A cross\-platform, fast and extensible general purpose fuzzy finder TUI.
|
A cross\-platform, fast and extensible general purpose fuzzy finder TUI.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
@ -73,6 +73,13 @@ This can be used to automatically select a channel based on the input
|
|||||||
prompt by using the `shell_integration` mapping in the configuration
|
prompt by using the `shell_integration` mapping in the configuration
|
||||||
file.
|
file.
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-exact\fR
|
||||||
|
Use substring matching instead of fuzzy matching.
|
||||||
|
|
||||||
|
This will use substring matching instead of fuzzy matching when
|
||||||
|
searching for entries. This is useful when the user wants to search for
|
||||||
|
an exact match instead of a fuzzy match e.g. to improve performance.
|
||||||
|
.TP
|
||||||
\fB\-\-select\-1\fR
|
\fB\-\-select\-1\fR
|
||||||
Automatically select and output the first entry if there is only one
|
Automatically select and output the first entry if there is only one
|
||||||
entry.
|
entry.
|
||||||
@ -102,13 +109,19 @@ when the user wants `tv` to run with a minimal interface (e.g. when
|
|||||||
using it as a file picker for a script or embedding it in a larger
|
using it as a file picker for a script or embedding it in a larger
|
||||||
application).
|
application).
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-ui\-scale\fR=\fIINTEGER\fR [default: 100]
|
||||||
|
Change the display size in relation to the available area.
|
||||||
|
|
||||||
|
This will crop the UI to a centered rectangle of the specified
|
||||||
|
percentage of the available area (e.g. 0.5 for 50% x 50%).
|
||||||
|
.TP
|
||||||
\fB\-h\fR, \fB\-\-help\fR
|
\fB\-h\fR, \fB\-\-help\fR
|
||||||
Print help (see a summary with \*(Aq\-h\*(Aq)
|
Print help (see a summary with \*(Aq\-h\*(Aq)
|
||||||
.TP
|
.TP
|
||||||
\fB\-V\fR, \fB\-\-version\fR
|
\fB\-V\fR, \fB\-\-version\fR
|
||||||
Print version
|
Print version
|
||||||
.TP
|
.TP
|
||||||
[\fICHANNEL\fR] [default: files]
|
[\fICHANNEL\fR]
|
||||||
Which channel shall we watch?
|
Which channel shall we watch?
|
||||||
|
|
||||||
A list of the available channels can be displayed using the
|
A list of the available channels can be displayed using the
|
||||||
@ -133,6 +146,6 @@ Initializes shell completion ("tv init zsh")
|
|||||||
television\-help(1)
|
television\-help(1)
|
||||||
Print this message or the help of the given subcommand(s)
|
Print this message or the help of the given subcommand(s)
|
||||||
.SH VERSION
|
.SH VERSION
|
||||||
v0.11.8
|
v0.11.9
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Alexandre Pasmantier <alex.pasmant@gmail.com>
|
Alexandre Pasmantier <alex.pasmant@gmail.com>
|
||||||
|
@ -134,6 +134,18 @@ pub struct Cli {
|
|||||||
#[arg(long, default_value = "false", verbatim_doc_comment)]
|
#[arg(long, default_value = "false", verbatim_doc_comment)]
|
||||||
pub no_help: bool,
|
pub no_help: bool,
|
||||||
|
|
||||||
|
/// Change the display size in relation to the available area.
|
||||||
|
///
|
||||||
|
/// This will crop the UI to a centered rectangle of the specified
|
||||||
|
/// percentage of the available area (e.g. 0.5 for 50% x 50%).
|
||||||
|
#[arg(
|
||||||
|
long,
|
||||||
|
value_name = "INTEGER",
|
||||||
|
default_value = "100",
|
||||||
|
verbatim_doc_comment
|
||||||
|
)]
|
||||||
|
pub ui_scale: u16,
|
||||||
|
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
pub command: Option<Command>,
|
pub command: Option<Command>,
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ pub struct PostProcessedCli {
|
|||||||
pub select_1: bool,
|
pub select_1: bool,
|
||||||
pub no_remote: bool,
|
pub no_remote: bool,
|
||||||
pub no_help: bool,
|
pub no_help: bool,
|
||||||
|
pub ui_scale: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for PostProcessedCli {
|
impl Default for PostProcessedCli {
|
||||||
@ -57,6 +58,7 @@ impl Default for PostProcessedCli {
|
|||||||
select_1: false,
|
select_1: false,
|
||||||
no_remote: false,
|
no_remote: false,
|
||||||
no_help: false,
|
no_help: false,
|
||||||
|
ui_scale: 100,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,6 +143,7 @@ impl From<Cli> for PostProcessedCli {
|
|||||||
select_1: cli.select_1,
|
select_1: cli.select_1,
|
||||||
no_remote: cli.no_remote,
|
no_remote: cli.no_remote,
|
||||||
no_help: cli.no_help,
|
no_help: cli.no_help,
|
||||||
|
ui_scale: cli.ui_scale,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,6 +114,7 @@ fn apply_cli_overrides(args: &PostProcessedCli, config: &mut Config) {
|
|||||||
if let Some(header) = &args.custom_header {
|
if let Some(header) = &args.custom_header {
|
||||||
config.ui.custom_header = Some(header.to_string());
|
config.ui.custom_header = Some(header.to_string());
|
||||||
}
|
}
|
||||||
|
config.ui.ui_scale = args.ui_scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_current_dir(path: &String) -> Result<()> {
|
pub fn set_current_dir(path: &String) -> Result<()> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user