Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data InputPattern = InputPattern {
- patternName :: String
- aliases :: [String]
- visibility :: Visibility
- args :: [(ArgumentDescription, IsOptional, ArgumentType)]
- help :: Pretty ColorText
- parse :: Arguments -> Either (Pretty ColorText) Input
- type Argument = Either String StructuredArgument
- data ArgumentType = ArgumentType {
- typeName :: String
- suggestions :: forall m v a. MonadIO m => String -> Codebase m v a -> AuthenticatedHttpClient -> ProjectPath -> m [Completion]
- fzfResolver :: Maybe FZFResolver
- type ArgumentDescription = Text
- type Arguments = [Argument]
- argType :: InputPattern -> Int -> Maybe ArgumentType
- data FZFResolver = FZFResolver {
- getOptions :: OptionFetcher
- data IsOptional
- data Visibility
- minArgs :: InputPattern -> Int
- maxArgs :: InputPattern -> Maybe Int
- unionSuggestions :: forall m v a. MonadIO m => [String -> Codebase m v a -> AuthenticatedHttpClient -> ProjectPath -> m [Completion]] -> String -> Codebase m v a -> AuthenticatedHttpClient -> ProjectPath -> m [Completion]
- suggestionFallbacks :: forall m v a. MonadIO m => [String -> Codebase m v a -> AuthenticatedHttpClient -> ProjectPath -> m [Completion]] -> String -> Codebase m v a -> AuthenticatedHttpClient -> ProjectPath -> m [Completion]
Documentation
data InputPattern Source #
InputPattern | |
|
type Argument = Either String StructuredArgument Source #
An argument to a command is either a string provided by the user which needs to be parsed or a numbered argument that doesn’t need to be parsed, as we’ve preserved its representation (although the numbered argument could still be of the wrong type, which should result in an error).
data ArgumentType Source #
ArgumentType | |
|
Instances
Show ArgumentType Source # | |
Defined in Unison.CommandLine.InputPattern showsPrec :: Int -> ArgumentType -> ShowS # show :: ArgumentType -> String # showList :: [ArgumentType] -> ShowS # |
type ArgumentDescription = Text Source #
Argument description It should fit grammatically into sentences like "I was expecting an argument for the argDesc" e.g. "namespace to merge", "definition to delete", "remote target to push to" etc.
argType :: InputPattern -> Int -> Maybe ArgumentType Source #
data FZFResolver Source #
FZFResolver | |
|
Instances
Show FZFResolver Source # | |
Defined in Unison.CommandLine.FZFResolvers showsPrec :: Int -> FZFResolver -> ShowS # show :: FZFResolver -> String # showList :: [FZFResolver] -> ShowS # |
data IsOptional Source #
Instances
Show IsOptional Source # | |
Defined in Unison.CommandLine.InputPattern showsPrec :: Int -> IsOptional -> ShowS # show :: IsOptional -> String # showList :: [IsOptional] -> ShowS # | |
Eq IsOptional Source # | |
Defined in Unison.CommandLine.InputPattern (==) :: IsOptional -> IsOptional -> Bool # (/=) :: IsOptional -> IsOptional -> Bool # |
data Visibility Source #
Instances
Show Visibility Source # | |
Defined in Unison.CommandLine.InputPattern showsPrec :: Int -> Visibility -> ShowS # show :: Visibility -> String # showList :: [Visibility] -> ShowS # | |
Eq Visibility Source # | |
Defined in Unison.CommandLine.InputPattern (==) :: Visibility -> Visibility -> Bool # (/=) :: Visibility -> Visibility -> Bool # | |
Ord Visibility Source # | |
Defined in Unison.CommandLine.InputPattern compare :: Visibility -> Visibility -> Ordering # (<) :: Visibility -> Visibility -> Bool # (<=) :: Visibility -> Visibility -> Bool # (>) :: Visibility -> Visibility -> Bool # (>=) :: Visibility -> Visibility -> Bool # max :: Visibility -> Visibility -> Visibility # min :: Visibility -> Visibility -> Visibility # |
Currently Unused
minArgs :: InputPattern -> Int Source #
unionSuggestions :: forall m v a. MonadIO m => [String -> Codebase m v a -> AuthenticatedHttpClient -> ProjectPath -> m [Completion]] -> String -> Codebase m v a -> AuthenticatedHttpClient -> ProjectPath -> m [Completion] Source #
Union suggestions from all possible completions
suggestionFallbacks :: forall m v a. MonadIO m => [String -> Codebase m v a -> AuthenticatedHttpClient -> ProjectPath -> m [Completion]] -> String -> Codebase m v a -> AuthenticatedHttpClient -> ProjectPath -> m [Completion] Source #
Try the first completer, if it returns no suggestions, try the second, etc.