@@ -658,7 +658,7 @@ module Run =
658658 printDescription usages
659659 printOptions usages.Options
660660
661- type Shell = Powershell
661+ type Shell = Powershell | Fish | Bash
662662
663663 let printCompletion appName shell =
664664 match shell with
@@ -671,6 +671,26 @@ Register-ArgumentCompleter -Native -CommandName %s -ScriptBlock {
671671 }
672672}
673673 """ appName appName
674+ | Fish ->
675+ printfn """
676+ function __%s _completion
677+ set -l count (commandline -pC)
678+ set -l cmd (commandline -opc)
679+ %s complete --position (math $count - (string length $cmd[1])) - 1 "$cmd[2..]"
680+ end
681+ complete -f -c %s -a '(__%s _completion)'
682+ """ appName appName appName appName
683+ | Bash ->
684+ printfn """
685+ __%s _completion()
686+ {
687+ local words=${COMP_WORDS[@]:1}
688+ local first_len=${#COMP_WORDS[0]}
689+ local point=$(( $COMP_POINT - $first_len - 1 ))
690+ COMPREPLY=( $(compgen -W "$(%s complete --position $point ${words[*]})") )
691+ }
692+ complete -F __%s _completion %s
693+ """ appName appName appName appName
674694
675695
676696 type TopCmd = CompleteCmd | CompletionCmd | RunCmd
@@ -692,7 +712,7 @@ Register-ArgumentCompleter -Native -CommandName %s -ScriptBlock {
692712 |> defaultValue Int32.MaxValue
693713
694714 let pShell =
695- let shells = Map.ofList [ " powershell" , Powershell ]
715+ let shells = Map.ofList [ " powershell" , Powershell; " fish " , Fish ; " bash " , Bash ]
696716 argc " shell" " the shell for which to emit the script" ( Completer.choices ( shells |> Map.toList |> List.map fst) )
697717 |> reqArg
698718 |> parse ( fun shell ->
0 commit comments