|
1 | 1 | -- | You don't need to import this module to enable bash completion. |
2 | | --- |
3 | | --- See |
4 | | --- <http://github.com/pcapriotti/optparse-applicative/wiki/Bash-Completion the wiki> |
5 | | --- for more information on bash completion. |
| 2 | +-- | |
| 3 | +-- | See [the wiki](http://github.com/pcapriotti/optparse-applicative/wiki/Bash-Completion) |
| 4 | +-- | for more information on bash completion. |
6 | 5 | module Options.Applicative.BashCompletion |
7 | 6 | ( bashCompletionParser |
8 | 7 | ) where |
@@ -85,7 +84,7 @@ bashCompletionQuery pinfo pprefs richness ws i _ = case runCompletion compl ppre |
85 | 84 | Just (Left (Tuple (SomeParser e) a)) |
86 | 85 | -> runExists (\p -> list_options a p) e |
87 | 86 | Just (Right c) |
88 | | - -> run_completer c |
| 87 | + -> run_completer c |
89 | 88 | Nothing |
90 | 89 | -> pure [] |
91 | 90 | where |
@@ -207,24 +206,23 @@ bashCompletionScript prog progn = pure |
207 | 206 | , "" |
208 | 207 | , "complete -o filenames -F _" <> progn <> " " <> progn ] |
209 | 208 |
|
210 | | -{- |
211 | | -/Note/: Fish Shell |
212 | | -
|
213 | | -Derived from Drezil's post in #169. |
214 | | -
|
215 | | -@ |
216 | | -commandline |
217 | | --c or --cut-at-cursor only print selection up until the current cursor position |
218 | | --o or --tokenize tokenize the selection and print one string-type token per line |
219 | | -@ |
220 | | -
|
221 | | -We tokenize so that the call to count (and hence --bash-completion-index) |
222 | | -gets the right number use cut-at-curstor to not bother sending anything |
223 | | -after the cursor position, which allows for completion of the middle of |
224 | | -words. |
225 | | -
|
226 | | -Tab characters separate items from descriptions. |
227 | | --} |
| 209 | +-- | |
| 210 | +-- | **Note**: Fish Shell |
| 211 | +-- | |
| 212 | +-- | Derived from Drezil's post in #169. |
| 213 | +-- | |
| 214 | +-- | ``` |
| 215 | +-- | commandline |
| 216 | +-- | -c or --cut-at-cursor only print selection up until the current cursor position |
| 217 | +-- | -o or --tokenize tokenize the selection and print one string-type token per line |
| 218 | +-- | ``` |
| 219 | +-- | |
| 220 | +-- | We tokenize so that the call to count (and hence --bash-completion-index) |
| 221 | +-- | gets the right number use cut-at-curstor to not bother sending anything |
| 222 | +-- | after the cursor position, which allows for completion of the middle of |
| 223 | +-- | words. |
| 224 | +-- | |
| 225 | +-- | Tab characters separate items from descriptions. |
228 | 226 | fishCompletionScript :: String -> String -> Effect (Array String) |
229 | 227 | fishCompletionScript prog progn = pure |
230 | 228 | [ " function _" <> progn |
|
0 commit comments