mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Fix the hard code of max depth
This commit is contained in:
@@ -6,7 +6,8 @@ include!("src/cli.rs");
|
|||||||
fn main() -> Result<(), Error> {
|
fn main() -> Result<(), Error> {
|
||||||
let outdir = "completions";
|
let outdir = "completions";
|
||||||
let app_name = "dust";
|
let app_name = "dust";
|
||||||
let mut cmd = build_cli();
|
let max_depth = usize::MAX.to_string();
|
||||||
|
let mut cmd = build_cli(&max_depth);
|
||||||
|
|
||||||
generate_to(Bash, &mut cmd, app_name, outdir)?;
|
generate_to(Bash, &mut cmd, app_name, outdir)?;
|
||||||
generate_to(Zsh, &mut cmd, app_name, outdir)?;
|
generate_to(Zsh, &mut cmd, app_name, outdir)?;
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
use clap::{Arg, Command};
|
use clap::{Arg, Command};
|
||||||
|
|
||||||
pub(crate) fn build_cli() -> Command<'static> {
|
pub fn build_cli(max_depth: &str) -> Command {
|
||||||
Command::new("Dust")
|
Command::new("Dust")
|
||||||
.about("Like du but more intuitive")
|
.about("Like du but more intuitive")
|
||||||
.version(env!("CARGO_PKG_VERSION"))
|
.version(env!("CARGO_PKG_VERSION"))
|
||||||
@@ -11,7 +11,7 @@ pub(crate) fn build_cli() -> Command<'static> {
|
|||||||
.long("depth")
|
.long("depth")
|
||||||
.help("Depth to show")
|
.help("Depth to show")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.default_value("18446744073709551615")
|
.default_value(max_depth)
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("number_of_lines")
|
Arg::new("number_of_lines")
|
||||||
|
|||||||
+1
-1
@@ -90,7 +90,7 @@ fn get_regex_value(maybe_value: Option<Values>) -> Vec<Regex> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let options = build_cli().get_matches();
|
let options = build_cli(&usize::MAX.to_string()).get_matches();
|
||||||
|
|
||||||
let config = get_config();
|
let config = get_config();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user