Commit fb70874f authored by Valentin Reis's avatar Valentin Reis

argotk.hs completion fix

parent 3a7b5b1d
Pipeline #4727 passed with stage
in 15 seconds
...@@ -8,7 +8,7 @@ _argotk.hs() ...@@ -8,7 +8,7 @@ _argotk.hs()
CMDLINE=(${CMDLINE[@]} --bash-completion-word $arg) CMDLINE=(${CMDLINE[@]} --bash-completion-word $arg)
done done
COMPREPLY=( $(./argotk/argotk.hs "${CMDLINE[@]}") ) COMPREPLY=( $(./argotk.hs "${CMDLINE[@]}") )
} }
complete -o filenames -F _argotk.hs argotk.hs complete -o filenames -F _argotk.hs argotk.hs
...@@ -39,7 +39,7 @@ let ...@@ -39,7 +39,7 @@ let
]; ];
shellHook = '' shellHook = ''
source completion/argotk.sh source ${./completion/argotk.sh}
echo "Installed bash completion." echo "Installed bash completion."
''; '';
......
...@@ -12,7 +12,7 @@ main = shakeArgs shakeOptions $ do ...@@ -12,7 +12,7 @@ main = shakeArgs shakeOptions $ do
want ["README.md", "completion/argotk.sh"] want ["README.md", "completion/argotk.sh"]
"completion/*.sh" "completion/*.sh"
%> \out -> mkCompletionRule out "bash" $ "argotk" </> takeFileName out -<.> "hs" %> \out -> mkCompletionRule out "bash" $ takeFileName out -<.> "hs"
"README.md" %> \out -> do "README.md" %> \out -> do
let template = ".README.md" let template = ".README.md"
...@@ -22,9 +22,8 @@ main = shakeArgs shakeOptions $ do ...@@ -22,9 +22,8 @@ main = shakeArgs shakeOptions $ do
[take (length panpipe - 1) panpipe, template, "-o", out] [take (length panpipe - 1) panpipe, template, "-o", out]
where where
mkCompletionAction str sn = mkCompletionAction str sn =
(sn, cmd ("./" ++ sn) ["--" ++ str ++ "-completion-script", "." </> sn]) (sn, cmd ("./argotk/" ++ sn) ["--" ++ str ++ "-completion-script", "." </> sn])
mkCompletionRule out str fn = do mkCompletionRule out str fn = do
let (needed, cplA) = mkCompletionAction str fn let (needed, cplA) = mkCompletionAction str fn
need [needed]
(Stdout cplScript) <- cplA (Stdout cplScript) <- cplA
liftIO $ writeFile out cplScript liftIO $ writeFile out cplScript
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment