Nushell: `nu` should have a mode like `bash -c`

Created on 28 Aug 2019  路  2Comments  路  Source: nushell/nushell

Original: "nu could read command so it could serve as a jq replacement"

Change usage to:

nu [OPTIONS] [COMMAND]

so you could do:

nu 'open https://api.github.com/repos/stedolan/jq/commits | first 1 | to-json'

This could make nu a viable replacement for jq so nu could sneak itself into bash scripts etc. that currently use jq. The equivalent jq command to the above is:

 curl https://api.github.com/repos/stedolan/jq/commits | jq '.[0]'

Care would have to be taken to pipe the stdin and stdout correctly.

enhancement needs-design

Most helpful comment

This makes a lot of sense to me. We could just make it -c like bash, but I bet there's gotchas about how bash -c works that we'd want to avoid.

All 2 comments

This makes a lot of sense to me. We could just make it -c like bash, but I bet there's gotchas about how bash -c works that we'd want to avoid.

We support nu -c now, closing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ProgrammingLife picture ProgrammingLife  路  3Comments

twe4ked picture twe4ked  路  4Comments

senden9 picture senden9  路  3Comments

triclops200 picture triclops200  路  4Comments

ne-on picture ne-on  路  5Comments