From fb70874f4cd15aaf905d4e989c97660928a69407 Mon Sep 17 00:00:00 2001 From: Valentin Reis Date: Thu, 20 Dec 2018 09:43:42 -0600 Subject: [PATCH] argotk.hs completion fix --- completion/argotk.sh | 2 +- default.nix | 2 +- shake.hs | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/completion/argotk.sh b/completion/argotk.sh index 7e23290..b5fec2e 100644 --- a/completion/argotk.sh +++ b/completion/argotk.sh @@ -8,7 +8,7 @@ _argotk.hs() CMDLINE=(${CMDLINE[@]} --bash-completion-word $arg) done - COMPREPLY=( $(./argotk/argotk.hs "${CMDLINE[@]}") ) + COMPREPLY=( $(./argotk.hs "${CMDLINE[@]}") ) } complete -o filenames -F _argotk.hs argotk.hs diff --git a/default.nix b/default.nix index 78ff7d9..ccd9563 100644 --- a/default.nix +++ b/default.nix @@ -39,7 +39,7 @@ let ]; shellHook = '' - source completion/argotk.sh + source ${./completion/argotk.sh} echo "Installed bash completion." ''; diff --git a/shake.hs b/shake.hs index d0ec664..8f26af8 100755 --- a/shake.hs +++ b/shake.hs @@ -12,7 +12,7 @@ main = shakeArgs shakeOptions $ do want ["README.md", "completion/argotk.sh"] "completion/*.sh" - %> \out -> mkCompletionRule out "bash" $ "argotk" takeFileName out -<.> "hs" + %> \out -> mkCompletionRule out "bash" $ takeFileName out -<.> "hs" "README.md" %> \out -> do let template = ".README.md" @@ -22,9 +22,8 @@ main = shakeArgs shakeOptions $ do [take (length panpipe - 1) panpipe, template, "-o", out] where mkCompletionAction str sn = - (sn, cmd ("./" ++ sn) ["--" ++ str ++ "-completion-script", "." sn]) + (sn, cmd ("./argotk/" ++ sn) ["--" ++ str ++ "-completion-script", "." sn]) mkCompletionRule out str fn = do let (needed, cplA) = mkCompletionAction str fn - need [needed] (Stdout cplScript) <- cplA liftIO $ writeFile out cplScript -- 2.26.2