Skip to content

Commit

Permalink
lens: fix parsing of lens options
Browse files Browse the repository at this point in the history
we were not passing args to options with args properly
  • Loading branch information
jqnatividad committed Sep 11, 2024
1 parent 91f026e commit 1cdd1bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cmd/lens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
}

if let Some(delimiter) = &args.flag_delimiter {
lens_args.push(format!("--delimiter={delimiter}"));
lens_args.extend_from_slice(&["--delimiter".to_string(), delimiter.to_string()]);
}

if args.flag_tab_separated {
Expand All @@ -65,23 +65,23 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
}

if let Some(columns) = &args.flag_columns {
lens_args.push(format!("--columns={columns}"));
lens_args.extend_from_slice(&["--columns".to_string(), columns.to_string()]);
}

if let Some(filter) = &args.flag_filter {
lens_args.push(format!("--filter={filter}"));
lens_args.extend_from_slice(&["--filter".to_string(), filter.to_string()]);
}

if let Some(find) = &args.flag_find {
lens_args.push(format!("--find={find}"));
lens_args.extend_from_slice(&["--find".to_string(), find.to_string()]);
}

if args.flag_ignore_case {
lens_args.push("--ignore-case".to_string());
}

if let Some(echo_column) = &args.flag_echo_column {
lens_args.push(format!("--echo-column {echo_column}"));
lens_args.extend_from_slice(&["--echo-column".to_string(), echo_column.to_string()]);
}

if args.flag_debug {
Expand Down

0 comments on commit 1cdd1bc

Please sign in to comment.