Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --argjson support #250

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Add --argjson support #250

merged 1 commit into from
Jan 14, 2025

Conversation

wader
Copy link
Contributor

@wader wader commented Dec 25, 2024

Fixes #180

@wader wader marked this pull request as draft December 25, 2024 18:48
jaq/src/main.rs Show resolved Hide resolved
jaq/src/main.rs Show resolved Hide resolved
jaq/src/cli.rs Show resolved Hide resolved
@wader
Copy link
Contributor Author

wader commented Dec 25, 2024

And hope your having great holidays!

@01mf02 01mf02 marked this pull request as ready for review January 14, 2025 08:47
@01mf02 01mf02 merged commit 865f3a2 into 01mf02:main Jan 14, 2025
3 checks passed
@01mf02
Copy link
Owner

01mf02 commented Jan 14, 2025

Very nice PR! Thanks a lot for this, @wader! (Was that some kind of Christmas present? ^^) Anyway, a belated "God Jul" to you as well!

jaq/src/cli.rs Show resolved Hide resolved
jaq/src/main.rs Show resolved Hide resolved
@@ -134,6 +134,15 @@ fn binds(cli: &Cli) -> Result<Vec<(String, Val)>, Error> {
let s = s.to_owned();
Ok((k.to_owned(), Val::Str(s.into())))
});
let argjson = cli.argjson.iter().map(|(k, s)| {
let s = s.to_owned();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need .to_owned() here, because parsing does not require an owned string. I removed this call in d268a57.

jaq/src/main.rs Show resolved Hide resolved
@wader
Copy link
Contributor Author

wader commented Jan 14, 2025

Very nice PR! Thanks a lot for this, @wader! (Was that some kind of Christmas present? ^^) Anyway, a belated "God Jul" to you as well!

Yeap! 🎅 same and a gott nytt år to you :)

@wader wader deleted the argjson branch January 14, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--argjson not supported
2 participants