From d12ee3bfa78699eab8f03d9b0d06ed2a9547ab37 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Wed, 4 Oct 2023 11:37:21 +0200 Subject: enable bash completion --- app/Main.hs | 2 +- default.nix | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index 87951b6..2e36d4c 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -98,7 +98,7 @@ showCommandParser :: O.Parser Command showCommandParser = Show <$> filesArg filesArg :: O.Parser [String] -filesArg = O.many (O.strArgument (O.metavar "FILE")) +filesArg = O.many (O.strArgument (O.metavar "FILE" <> O.action "file")) main :: IO () main = do diff --git a/default.nix b/default.nix index 722d91c..1708430 100644 --- a/default.nix +++ b/default.nix @@ -7,7 +7,13 @@ let haskellPackages = pkgs.haskellPackages.override { overrides = self: super: { - anissue = super.callCabal2nix "anissue" ./. {}; + anissue = (super.callCabal2nix "anissue" ./. { }).overrideAttrs (oldAttrs: { + postInstall = '' + exe=${oldAttrs.pname} + mkdir -p $out/share/bash-completion/completions + $out/bin/$exe --bash-completion-script $exe >$out/share/bash-completion/completions/$exe + ''; + }); }; }; -- cgit v1.2.3