Safe Haskell | Safe-Infered |
---|
System.Console.CmdArgs.Explicit.Complete
Description
This module does command line completion
Documentation
data Complete
How to complete a command line option.
The Show
instance is suitable for parsing from shell scripts.
Constructors
CompleteValue String | Complete to a particular value |
CompleteFile String FilePath | Complete to a prefix, and a file |
CompleteDir String FilePath | Complete to a prefix, and a directory |
Arguments
:: Mode a | Mode specifying which arguments are allowed |
-> [String] | Arguments the user has already typed |
-> (Int, Int) | 0-based index of the argument they are currently on, and the position in that argument |
-> [Complete] |
Given a current state, return the set of commands you could type now, in preference order.
completeBash :: String -> [String]
completeZsh :: String -> [String]