Module

Node.Yargs.Applicative

#Y

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

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

class Arg a  where

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

Members

Instances

#yarg

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

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

rest :: Y (Array Foreign)

Get the raw command line arguments object.

Modules