diff options
author | Profpatsch <mail@profpatsch.de> | 2019-09-09 01:54:51 +0200 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2019-09-09 02:01:23 +0200 |
commit | dcf2f789cca133b27d408f984bb398b14ea925d3 (patch) | |
tree | d50a067b3133916f225bd0359adac8dc8e8679d3 /pkgs/profpatsch/dhallsh/main.dhall | |
parent | 654e7f931201a7fe435624aa4412bb1fcc4fedb7 (diff) |
`abc foo --bar` can be completed
Diffstat (limited to 'pkgs/profpatsch/dhallsh/main.dhall')
-rw-r--r-- | pkgs/profpatsch/dhallsh/main.dhall | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/pkgs/profpatsch/dhallsh/main.dhall b/pkgs/profpatsch/dhallsh/main.dhall index 36be6142..86300b79 100644 --- a/pkgs/profpatsch/dhallsh/main.dhall +++ b/pkgs/profpatsch/dhallsh/main.dhall @@ -125,7 +125,7 @@ in let fishSeenSubcommandFn = "__fish_seen_subcommand_from" let fishUseSubcommandFn = "__fish_use_subcommand" - let foo + let fooSubcommand : Command Argument = completeToCommand ( complete { cmd = "abc", description = "this is foo option" } @@ -136,5 +136,26 @@ in let fishSeenSubcommandFn = "__fish_seen_subcommand_from" } ) - in [ argCommandToList foo, [ "complete", "--do-complete=abc " ] ] + let fooSubcommandBarOption + : Command Argument + = completeToCommand + ( complete { cmd = "abc", description = "will bar the baz" } + ⫽ { condition = + Some + { cmd = + fishSeenSubcommandFn + , args = + [ Argument.Plain "foo" ] + } + , long-option = + Some "bar" + , short-option = + Some "b" + } + ) + + in [ argCommandToList fooSubcommand + , argCommandToList fooSubcommandBarOption + , [ "complete", "--do-complete=abc foo -" ] + ] : List (List Text) |