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

Generic shell completion support for the 'nix' command #3587

Merged
merged 11 commits into from May 12, 2020
Merged

Conversation

edolstra
Copy link
Member

This adds completion support for the nix command. For example:

$ nix build nixpkgs#thunderb<TAB>
nixpkgs#thunderbird      nixpkgs#thunderbird-bin  nixpkgs#thunderbolt

This is mostly shell-independent: the bash completion script just runs the nix command with the environment variable NIX_GET_COMPLETIONS set. nix then prints the completions on stdout. So it shouldn't be hard to enable support for other shells.

Any flag / argument can get custom completion by setting a completer function.

@edolstra edolstra merged commit 215f09d into flakes May 12, 2020
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.

None yet

1 participant