Switch to using newlines as separator between completions
parent
327f596d1d
commit
9337ab8d40
|
@ -126,7 +126,7 @@ addShellCompletionCommand mainCmdParser = do
|
||||||
let lastWord =
|
let lastWord =
|
||||||
reverse $ takeWhile (not . Char.isSpace) $ reverse $ inputString
|
reverse $ takeWhile (not . Char.isSpace) $ reverse $ inputString
|
||||||
rest
|
rest
|
||||||
putStrLn $ List.intercalate "\t" $ compls <&> \case
|
putStrLn $ List.unlines $ compls <&> \case
|
||||||
CompletionString s -> s
|
CompletionString s -> s
|
||||||
CompletionFile -> "$(compgen -f -- " ++ lastWord ++ ")"
|
CompletionFile -> "$(compgen -f -- " ++ lastWord ++ ")"
|
||||||
CompletionDirectory -> "$(compgen -d -- " ++ lastWord ++ ")"
|
CompletionDirectory -> "$(compgen -d -- " ++ lastWord ++ ")"
|
||||||
|
@ -149,13 +149,13 @@ completionScriptBash exeName =
|
||||||
List.unlines
|
List.unlines
|
||||||
$ [ "function _" ++ exeName ++ "()"
|
$ [ "function _" ++ exeName ++ "()"
|
||||||
, "{"
|
, "{"
|
||||||
, " local IFS=$'\\t'"
|
, " local IFS=$'\\n'"
|
||||||
, " COMPREPLY=()"
|
, " COMPREPLY=()"
|
||||||
, " local result=$("
|
, " local result=$("
|
||||||
++ exeName
|
++ exeName
|
||||||
++ " completion bash-gen \"${COMP_WORDS[@]:1}\")"
|
++ " completion bash-gen \"${COMP_WORDS[@]:1}\")"
|
||||||
, " for r in ${result[@]}; do"
|
, " for r in ${result[@]}; do"
|
||||||
, " local IFS=$'\\n\\t '"
|
, " local IFS=$'\\n '"
|
||||||
, " for s in $(eval echo ${r}); do"
|
, " for s in $(eval echo ${r}); do"
|
||||||
, " COMPREPLY+=(${s})"
|
, " COMPREPLY+=(${s})"
|
||||||
, " done"
|
, " done"
|
||||||
|
|
Loading…
Reference in New Issue