You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's one pretty straightforward thing to do here: provide reasonable completion for things like builders and stores.
Unfortunately nix --help-config dosen't report the type of an option. That means we'll have to build a manual lookup table for known options (with sane fallback).
We also want to at least recognize the short form of options (nix build --no-sandbox etc.). Thankfully we can infer boolean types from descriptions starting with Whether . Meaning we're able to determine if a short option takes an argument or not automatically. That way we won't mistake an option argument as a normal argument (eg. nix-build --foo bar -A baz).
I feel that completing all the options by default is a bad idea, as there's a ton of them which makes it hard to pick out the important stuff. We do something similar with nix-store completing everything only after we've started to type --*: https://github.com/spwhitt/nix-zsh-completions/blob/master/_nix-store#L134. Though I'm not sure if it's easy to make a general solution for this, and since we're dealing with optargs we'll have to provide the necessary information to _arguments when necessary.
The text was updated successfully, but these errors were encountered:
There's one pretty straightforward thing to do here: provide reasonable completion for things like builders and stores.
Unfortunately
nix --help-config
dosen't report the type of an option. That means we'll have to build a manual lookup table for known options (with sane fallback).We also want to at least recognize the short form of options (
nix build --no-sandbox
etc.). Thankfully we can infer boolean types from descriptions starting withWhether
. Meaning we're able to determine if a short option takes an argument or not automatically. That way we won't mistake an option argument as a normal argument (eg.nix-build --foo bar -A baz
).I feel that completing all the options by default is a bad idea, as there's a ton of them which makes it hard to pick out the important stuff. We do something similar with
nix-store
completing everything only after we've started to type--*
: https://github.com/spwhitt/nix-zsh-completions/blob/master/_nix-store#L134. Though I'm not sure if it's easy to make a general solution for this, and since we're dealing with optargs we'll have to provide the necessary information to_arguments
when necessary.The text was updated successfully, but these errors were encountered: