mirror of
https://github.com/sharkdp/bat
synced 2026-08-06 19:21:43 +00:00
refactor: Port to clap3
Ths does remove the specialization of version's description. The way this is done (internally through `mut_arg`) doesn't play well with subcommands. Clap tries to force this version of `version` into the subcommand despite not being needed. Clap v4 dramatically changes how version customization works. clap also does more error checks now to prevent programmer mistake, so we can't have a conflict with an argument that is conditionally there, so I swapped the condition.
This commit is contained in:
+2
-2
@@ -32,7 +32,7 @@ fn is_truecolor_terminal() -> bool {
|
||||
}
|
||||
|
||||
pub struct App {
|
||||
pub matches: ArgMatches<'static>,
|
||||
pub matches: ArgMatches,
|
||||
interactive_output: bool,
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ impl App {
|
||||
})
|
||||
}
|
||||
|
||||
fn matches(interactive_output: bool) -> Result<ArgMatches<'static>> {
|
||||
fn matches(interactive_output: bool) -> Result<ArgMatches> {
|
||||
let args = if wild::args_os().nth(1) == Some("cache".into())
|
||||
|| wild::args_os().any(|arg| arg == "--no-config")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user