Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module handles parsing CLI arguments into Command
s.
See the excellent documentation at https://hackage.haskell.org/package/optparse-applicative
Synopsis
- data RunSource
- data ShouldForkCodebase
- data ShouldSaveCodebase
- data CodebasePathOption
- data ShouldExit
- data IsHeadless
- data Command
- data GlobalOptions = GlobalOptions {}
- rootParserInfo :: String -> String -> CodebaseServerOpts -> ParserInfo (GlobalOptions, Command)
- type UsageRenderer = Maybe String -> String
- parseCLIArgs :: String -> String -> IO (UsageRenderer, GlobalOptions, Command)
- codebaseServerOptsFromEnv :: IO CodebaseServerOpts
- renderUsage :: String -> ParserInfo a -> ParserPrefs -> Maybe String -> String
- versionCommand :: Mod CommandFields Command
- initCommand :: Mod CommandFields Command
- runDesc :: String -> String -> String
- runSymbolCommand :: Mod CommandFields Command
- runFileCommand :: Mod CommandFields Command
- runPipeCommand :: Mod CommandFields Command
- runCompiledCommand :: Mod CommandFields Command
- transcriptCommand :: Mod CommandFields Command
- transcriptForkCommand :: Mod CommandFields Command
- commandParser :: CodebaseServerOpts -> Parser Command
- globalOptionsParser :: Parser GlobalOptions
- codebasePathParser :: Parser (Maybe CodebasePathOption)
- codebaseCreateParser :: Parser (Maybe CodebasePathOption)
- exitParser :: Parser ShouldExit
- lspFormattingParser :: Parser LspFormattingConfig
- versionOptionParser :: String -> String -> Parser (a -> a)
- launchHeadlessCommand :: CodebaseServerOpts -> Mod CommandFields Command
- codebaseServerOptsParser :: CodebaseServerOpts -> Parser CodebaseServerOpts
- launchParser :: CodebaseServerOpts -> IsHeadless -> Parser Command
- initParser :: Parser Command
- versionParser :: Parser Command
- runArgumentParser :: Parser [String]
- runHQParser :: Parser (HashQualified Name)
- runProjectPathParser :: Parser ProjectPathNames
- runSymbolParser :: Parser Command
- runFileParser :: Parser Command
- runPipeParser :: Parser Command
- runCompiledParser :: Parser Command
- rtsStatsOption :: Parser (Maybe RtsStatsPath)
- saveCodebaseFlag :: Parser ShouldSaveCodebase
- saveCodebaseToFlag :: Parser ShouldSaveCodebase
- startingProjectOption :: Parser (Maybe (ProjectAndBranch ProjectName ProjectBranchName))
- noFileWatchFlag :: Parser ShouldWatchFiles
- readAbsolutePath :: ReadM Absolute
- nativeRuntimePathFlag :: Parser (Maybe FilePath)
- readPath' :: ReadM Path'
- readProjectAndBranchNames :: ReadM (ProjectAndBranch ProjectName ProjectBranchName)
- fileArgument :: String -> Parser FilePath
- transcriptParser :: Parser Command
- transcriptForkParser :: Parser Command
- unisonHelp :: String -> String -> Doc
Documentation
Valid ways to provide source code to the run command
data ShouldForkCodebase Source #
Instances
Show ShouldForkCodebase Source # | |
Defined in ArgParse showsPrec :: Int -> ShouldForkCodebase -> ShowS # show :: ShouldForkCodebase -> String # showList :: [ShouldForkCodebase] -> ShowS # | |
Eq ShouldForkCodebase Source # | |
Defined in ArgParse (==) :: ShouldForkCodebase -> ShouldForkCodebase -> Bool # (/=) :: ShouldForkCodebase -> ShouldForkCodebase -> Bool # |
data ShouldSaveCodebase Source #
Instances
Show ShouldSaveCodebase Source # | |
Defined in ArgParse showsPrec :: Int -> ShouldSaveCodebase -> ShowS # show :: ShouldSaveCodebase -> String # showList :: [ShouldSaveCodebase] -> ShowS # | |
Eq ShouldSaveCodebase Source # | |
Defined in ArgParse (==) :: ShouldSaveCodebase -> ShouldSaveCodebase -> Bool # (/=) :: ShouldSaveCodebase -> ShouldSaveCodebase -> Bool # |
data CodebasePathOption Source #
Instances
Show CodebasePathOption Source # | |
Defined in ArgParse showsPrec :: Int -> CodebasePathOption -> ShowS # show :: CodebasePathOption -> String # showList :: [CodebasePathOption] -> ShowS # | |
Eq CodebasePathOption Source # | |
Defined in ArgParse (==) :: CodebasePathOption -> CodebasePathOption -> Bool # (/=) :: CodebasePathOption -> CodebasePathOption -> Bool # |
data ShouldExit Source #
Instances
Show ShouldExit Source # | |
Defined in ArgParse showsPrec :: Int -> ShouldExit -> ShowS # show :: ShouldExit -> String # showList :: [ShouldExit] -> ShowS # | |
Eq ShouldExit Source # | |
Defined in ArgParse (==) :: ShouldExit -> ShouldExit -> Bool # (/=) :: ShouldExit -> ShouldExit -> Bool # |
data IsHeadless Source #
Instances
Show IsHeadless Source # | |
Defined in ArgParse showsPrec :: Int -> IsHeadless -> ShowS # show :: IsHeadless -> String # showList :: [IsHeadless] -> ShowS # | |
Eq IsHeadless Source # | |
Defined in ArgParse (==) :: IsHeadless -> IsHeadless -> Bool # (/=) :: IsHeadless -> IsHeadless -> Bool # |
Represents commands the cli can run.
Note that this is not one-to-one with command-parsers since some are simple variants. E.g. run, run.file, run.pipe
data GlobalOptions Source #
Options shared by sufficiently many subcommands.
Instances
Show GlobalOptions Source # | |
Defined in ArgParse showsPrec :: Int -> GlobalOptions -> ShowS # show :: GlobalOptions -> String # showList :: [GlobalOptions] -> ShowS # | |
Eq GlobalOptions Source # | |
Defined in ArgParse (==) :: GlobalOptions -> GlobalOptions -> Bool # (/=) :: GlobalOptions -> GlobalOptions -> Bool # |
rootParserInfo :: String -> String -> CodebaseServerOpts -> ParserInfo (GlobalOptions, Command) Source #
The root-level ParserInfo
.
parseCLIArgs :: String -> String -> IO (UsageRenderer, GlobalOptions, Command) Source #
Parse the command description, options, and usage information from provided cli arguments.
codebaseServerOptsFromEnv :: IO CodebaseServerOpts Source #
Load default options from environment variables.
renderUsage :: String -> ParserInfo a -> ParserPrefs -> Maybe String -> String Source #
Purely renders the full help summary for the CLI, or an optional subcommand.
launchParser :: CodebaseServerOpts -> IsHeadless -> Parser Command Source #
runArgumentParser :: Parser [String] Source #