1
1
mirror of https://github.com/tweag/nickel.git synced 2024-09-11 11:47:03 +03:00
nickel/cli/tests
Yann Hamdaoui eda326f92b
Add a --field argument to subcommands whenever it makes sense (#1712)
* Factor out extract_field() from query()

* Add selectable field to Program

* Add --field to supported commands

This commit finishes the series on adding `--field` argument to the CLI.
This argument is factorized as a new Customize implementer which
regroups commands that don't support general customization (overriding)
but still support selecting a specific field from the configuration.
It's added to the full customization as well.

In consequence, commands that didn't support selecting particular field
before now generically support the `--field` argument. The `--path`
argument for `--query` is removed and is just a `--field` argument for
`nickel query`.

* Fix not taking the --field into account when not customizing

* Formatting

* Fix tests for new --field argument

* Fix clippy warning

* Fix compilation errors, tests, and improve error messages

* Avoid duplicating 'field' declaration in clap
2023-11-16 11:37:54 +00:00
..
integration Make eval an explicit subcommand and restructure the CLI somewhat (#1632) 2023-09-26 20:31:30 +00:00
snapshot Add a --field argument to subcommands whenever it makes sense (#1712) 2023-11-16 11:37:54 +00:00