Repository navigation
Conversation
clap_complete's fish generator does not complete positional arguments, so `colmena apply <TAB>` offered files instead of the goals, and it cannot know the nodes of a hive, so `--on <TAB>` offered files too. gen-completions fish now appends: - the possible values of positional arguments, taken from the clap definitions (the goals of `apply` and `apply-local`); - a completion for `--on` that evaluates the node names of the hive with `colmena eval`, honouring -f/--config, and completes comma-separated lists. `--on` also gets `ValueHint::Other`, so bash and zsh stop offering file names for it as well.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In fish,
colmena apply <TAB>andcolmena apply --on <TAB>both complete file names:applyandapply-localare missing, althoughGoalis aValueEnum.--onhas no value hint, and a static completion file cannot know the nodes of a hive.gen-completions fishnow appends to clap's output:__fish_colmena_nodesfunction that evaluates the node names withcolmena eval -E '{ nodes, ... }: builtins.attrNames nodes', passing on-f/--configfrom the command line, and completes--onwith it forapply,build,execandupload-keys, comma-separated lists included (__fish_append).Tags are not completed: their
deployment.tagsneeds each node's configuration to be evaluated, which took 5 s for 4 nodes here, against under 1 s for the names.--onalso getsValueHint::Other, so bash and zsh stop offering file names for it too; elvish and PowerShell completions are unchanged.Testing
nix develop -c cargo test(with a new unit test for the generated fish completions),nix fmtandnix buildpass.colmena apply <TAB>→boot build dry-activate push switch test upload-keyscolmena apply --on <TAB>→ the 4 node names (about 0.7 s)colmena apply --on node-a,<TAB>→node-a,node-b…colmena -f /path/to/flake.nix apply --on <TAB>from another directory → the node names--on <TAB>completes nothing rather than files.