on master help sign in
Cut completion feature for now
a76b120Evan Czaplicki
ui/terminal/src/Terminal/Args.hs+3−24
@@ -43,16 +43,6 @@ 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
45
45
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−
56 chunks ->
46 chunks ->
57 if elem "--help" chunks then
47 if elem "--help" chunks then
58 Error.exitWithHelp Nothing details example args_ flags_
48 Error.exitWithHelp Nothing details example args_ flags_
@@ -83,19 +73,8 @@ complex intro outro interfaces =
83 do hPutStrLn stdout (Pkg.versionToString Compiler.version)
73 do hPutStrLn stdout (Pkg.versionToString Compiler.version)
84 Exit.exitSuccess
74 Exit.exitSuccess
85
75
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−
96 command : chunks ->
76 command : chunks ->
97− do maybeAutoComplete argStrings (complexSuggest interfaces)
98− case List.find (\iface -> toName iface == command) interfaces of
77+ do case List.find (\iface -> toName iface == command) interfaces of
99 Nothing ->
78 Nothing ->
100 Error.exitWithUnknown command (map toName interfaces)
79 Error.exitWithUnknown command (map toName interfaces)
101
80
@@ -116,8 +95,8 @@ complex intro outro interfaces =
116-- AUTO-COMPLETE
95-- AUTO-COMPLETE
117
96
118
97
119−maybeAutoComplete :: [String] -> (Int -> [String] -> IO [String]) -> IO ()
98+_maybeAutoComplete :: [String] -> (Int -> [String] -> IO [String]) -> IO ()
120−maybeAutoComplete argStrings getSuggestions =
99+_maybeAutoComplete argStrings getSuggestions =
121 if length argStrings /= 3 then
100 if length argStrings /= 3 then
122 return ()
101 return ()
123 else
102 else