unison-cli-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

ArgParse

Description

This module handles parsing CLI arguments into Commands. See the excellent documentation at https://hackage.haskell.org/package/optparse-applicative

Synopsis

Documentation

data RunSource Source #

Valid ways to provide source code to the run command

Instances

Instances details
Show RunSource Source # 
Instance details

Defined in ArgParse

Eq RunSource Source # 
Instance details

Defined in ArgParse

data ShouldExit Source #

Constructors

Exit 
DoNotExit 

Instances

Instances details
Show ShouldExit Source # 
Instance details

Defined in ArgParse

Eq ShouldExit Source # 
Instance details

Defined in ArgParse

data IsHeadless Source #

Constructors

Headless 
WithCLI 

Instances

Instances details
Show IsHeadless Source # 
Instance details

Defined in ArgParse

Eq IsHeadless Source # 
Instance details

Defined in ArgParse

data Command Source #

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

Instances

Instances details
Show Command Source # 
Instance details

Defined in ArgParse

Eq Command Source # 
Instance details

Defined in ArgParse

Methods

(==) :: Command -> Command -> Bool #

(/=) :: Command -> Command -> Bool #

data GlobalOptions Source #

Options shared by sufficiently many subcommands.

Instances

Instances details
Show GlobalOptions Source # 
Instance details

Defined in ArgParse

Eq GlobalOptions Source # 
Instance details

Defined in ArgParse

type UsageRenderer Source #

Arguments

 = Maybe String

Optional sub-command to render help for

-> String 

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.