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

CLI improvement: nickel eval and positional file arguments #1620

Closed
yannham opened this issue Sep 21, 2023 · 1 comment
Closed

CLI improvement: nickel eval and positional file arguments #1620

yannham opened this issue Sep 21, 2023 · 1 comment

Comments

@yannham
Copy link
Member

yannham commented Sep 21, 2023

Is your feature request related to a problem? Please describe.

The default behavior of the Nickel command is to deeply evaluate a program and pretty-print the result. Experience has shown that it's not very intuitive: all other actions correspond to a subcommand, and what's more, evaluation is not necessarily the most used one (it's probably nickel export). So, it doesn't make a lot of sense to have it be the default behavior.

A second detail is to have to use nickel export -f foo.ncl. It's cool that Nickel uses stdin by default, to allow piping with other commands, but most of the time we want to export a specific file: it's the main expected argument of most subcommand. In that case, we could use positional arguments instead and just write nickel export foo.ncl. As a natural extension, we could provide multiple Nickel files, the semantics being to merge them all: nickel export network.ncl firewall.ncl cpu.ncl would be equivalent to nickel export <<< '(import "network.ncl") & (import "firewall.ncl") & (import "cpu.ncl")'.

Describe the solution you'd like

Get rid of the default behavior of nickel: that is, you have to specify a subcommand, and add a subcommand nickel eval which would correspond to the current plain nickel invocation.

Get rid of the argument -f/--file and use positional arguments instead to pass files to evaluate.

@vkleen
Copy link
Contributor

vkleen commented Sep 28, 2023

Done in #1632

@vkleen vkleen closed this as completed Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants