Skip to content

Commit

Permalink
just make the param optional, jq also supports it
Browse files Browse the repository at this point in the history
Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Sep 19, 2023
1 parent 34d0e8f commit 297538a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion yq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ struct Args {

impl Args {
fn jq_args(&self) -> Vec<String> {
let mut args = vec![self.jq_query.clone().unwrap_or_else(|| ".".into())];
let mut args = vec![];
if let Some(query) = &self.jq_query {
args.push(query.into())
}
if self.compact_output {
args.push("-c".into());
}
Expand Down

0 comments on commit 297538a

Please sign in to comment.