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 Source #

A shell complete function.

#### Instances

Instances details

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

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

Smart constructor for a `Completer`

listIOCompleter :: IO [String] -> Completer Source #

Create a `Completer` from an IO action

listCompleter :: [String] -> Completer Source #

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

bashCompleter :: String -> Completer Source #

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 Source #

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.