@@ -43,6 +43,16 @@ simple details example args_ flags_ callback =
4343 do hPutStrLn stdout (Pkg.versionToString Compiler.version)
4444 Exit.exitSuccess
4545
46+ "autocomplete" : n : chunks ->
47+ case Read.readMaybe n of
48+ Nothing ->
49+ Exit.exitFailure
50+
51+ Just index ->
52+ do suggestions <- fst $ Chomp.chomp (Just index) chunks args_ flags_
53+ hPutStr stdout (unlines suggestions)
54+ Exit.exitFailure
55+
4656 chunks ->
4757 if elem "--help" chunks then
4858 Error.exitWithHelp Nothing details example args_ flags_
@@ -73,6 +83,16 @@ complex intro outro interfaces =
7383 do hPutStrLn stdout (Pkg.versionToString Compiler.version)
7484 Exit.exitSuccess
7585
86+ "autocomplete" : n : chunks ->
87+ case Read.readMaybe n of
88+ Nothing ->
89+ Exit.exitFailure
90+
91+ Just index ->
92+ do suggestions <- complexSuggest interfaces index chunks
93+ hPutStr stdout (unlines suggestions)
94+ Exit.exitFailure
95+
7696 command : chunks ->
7797 do maybeAutoComplete argStrings (complexSuggest interfaces)
7898 case List.find (\iface -> toName iface == command) interfaces of