nix(feat): Add bash completion for git references

This commit is contained in:
Wolfgang Walther
2022-06-03 22:19:16 -05:00
committed by Steve Chavez
parent 1aebe62a03
commit 88674c5af6
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;
}
''