Module

Node.Yargs.Applicative

Package
purescript-yargs
Repository
paf31/purescript-yargs

#Y Source

newtype Y a

The Y applicative functor can be used to build values from command-line arguments, providing a more idiomatic interface to the yargs library.

Instances

#runY Source

runY :: forall a. YargsSetup -> Y (Effect a) -> Effect a

Compute some Eff action using command-line arguments, and run it.

This function can throw exceptions.

#Arg Source

class Arg a  where

The Arg class describes types which can be parsed from the command line.

Members

Instances

#yarg Source

yarg :: forall a. Arg a => String -> Array String -> Maybe String -> Either a String -> Boolean -> Y a

Describe a single command line argument.

The arguments are, in order:

  • The key name and default argument name
  • Any aliases which can be used in place of the key
  • An optional description
  • Either a default value or a message to show if this field is required
  • Whether or not an associated value is required

#flag Source

flag :: String -> Array String -> Maybe String -> Y Boolean

Describe a boolean-valued flag.

The arguments are, in order:

  • The key name and default argument name
  • Any aliases which can be used in place of the key
  • An optional description

#rest Source

rest :: Y (Array Foreign)

Get the raw command line arguments object.