Options.Applicative.Builder.Completer

optparse-applicative-0.18.1.0: Utilities and combinators for parsing command line options

Safe Haskell | Safe-Inferred
Language | Haskell98

Options.Applicative.Builder.Completer

Synopsis

- data Completer
- mkCompleter :: (String -> IO [String]) -> Completer
- listIOCompleter :: IO [String] -> Completer
- listCompleter :: [String] -> Completer
- bashCompleter :: String -> Completer
- requote :: String -> String

# Documentation

data Completer #

A shell complete function.

#### Instances

Instances details

Monoid Completer # |
Instance details Defined in Options.Applicative.Types Methods mempty :: Completer # mappend :: Completer -> Completer -> Completer # mconcat :: [Completer] -> Completer #
Semigroup Completer # |
Instance details Defined in Options.Applicative.Types Methods (<>) :: Completer -> Completer -> Completer # sconcat :: NonEmpty Completer -> Completer # stimes :: Integral b => b -> Completer -> Completer #

mkCompleter :: (String -> IO [String]) -> Completer #

Smart constructor for a `Completer`

listIOCompleter :: IO [String] -> Completer #

Create a `Completer` from an IO action

listCompleter :: [String] -> Completer #

Create a `Completer` from a constant list of strings.

bashCompleter :: String -> Completer #

Run a compgen completion action.

Common actions include `file` and `directory`. See http://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html#Programmable-Completion-Builtins for a complete list.

requote :: String -> String #

Strongly quote the string we pass to compgen.

We need to do this so bash doesn't expand out any ~ or other chars we want to complete on, or emit an end of line error when seeking the close to the quote.