nix-output-monitor
nix-output-monitor copied to clipboard
feat: add bash completion
Note: this is just for the nom <subcommand>
usage. But a similar trick can be used for nom-build
.
Adds bash completion calling nix's and correcting the order of the args.
Another approach would be to call the normal bash nix completion but correct for the additional three arguments injected by nom, but this seems a bit cleaner to chain load the completion script.
Fixes: https://github.com/maralorn/nix-output-monitor/issues/31
Thank you very much. This is a long-awaited improvement! I left a few comments.
Have you tested this successfully? When I test this I get the output below, where I think the noise with the "Finished at" will probably break completion? At least completion didn’t work for me in a nix shell.
[maralorn@hephaistos:~]$ NIX_GET_COMPLETIONS=1 nix build pkgs#
normal
build
[maralorn@hephaistos:~]$ NIX_GET_COMPLETIONS=1 nom build pkgs#
Finished at 22:26:31 after 0s
normal
build
I also was unable to get this to work at all, even with futzing to remove runMonitoredCommand
when NIX_GET_COMPLETIONS
was set. (The Finished at 22:26:31 after 0s
is coming from the runMonitoredCommand
code.)