@@ -43,6 +43,16 @@ simple details example args_ flags_ callback =
43 do hPutStrLn stdout (Pkg.versionToString Compiler.version)
43 do hPutStrLn stdout (Pkg.versionToString Compiler.version)
44 Exit.exitSuccess
44 Exit.exitSuccess
46+ "autocomplete" : n : chunks ->
47+ case Read.readMaybe n of
52+ do suggestions <- fst $ Chomp.chomp (Just index) chunks args_ flags_
53+ hPutStr stdout (unlines suggestions)
47 if elem "--help" chunks then
57 if elem "--help" chunks then
48 Error.exitWithHelp Nothing details example args_ flags_
58 Error.exitWithHelp Nothing details example args_ flags_
@@ -73,6 +83,16 @@ complex intro outro interfaces =
73 do hPutStrLn stdout (Pkg.versionToString Compiler.version)
83 do hPutStrLn stdout (Pkg.versionToString Compiler.version)
74 Exit.exitSuccess
84 Exit.exitSuccess
86+ "autocomplete" : n : chunks ->
87+ case Read.readMaybe n of
92+ do suggestions <- complexSuggest interfaces index chunks
93+ hPutStr stdout (unlines suggestions)
76 command : chunks ->
96 command : chunks ->
77 do maybeAutoComplete argStrings (complexSuggest interfaces)
97 do maybeAutoComplete argStrings (complexSuggest interfaces)
78 case List.find (\iface -> toName iface == command) interfaces of
98 case List.find (\iface -> toName iface == command) interfaces of