nix(feat): Add bash completion for git references

This commit is contained in:
Wolfgang Walther
2021-11-27 10:57:29 +01:00
committed by Wolfgang Walther
parent 32ff9dfb48
commit 5a8d9b1246
5 changed files with 35 additions and 15 deletions
+10 -1
View File
@@ -61,9 +61,12 @@ let
'';
loadtestAgainst =
let
name = "postgrest-loadtest-against";
in
checkedShellScript
{
name = "postgrest-loadtest-against";
inherit name;
docs =
''
Run the vegeta loadtest twice:
@@ -74,6 +77,12 @@ let
"ARG_POSITIONAL_SINGLE([target], [Commit-ish reference to compare with])"
"ARG_LEFTOVERS([additional vegeta arguments])"
];
positionalCompletion =
''
if test "$prev" == "${name}"; then
__gitcomp_nl "$(__git_refs)"
fi
'';
inRootDir = true;
}
''