cli-0.0.1: Simple Command Line Interface Library

LicenseBSD-Style
Safe HaskellSafe-Inferred
LanguageHaskell2010

Application.CLI

Contents

Description

Copyright : Copyright © 2014 Nicolas DI PRIMA

Maintainer : Nicolas DI PRIMA nicolas@di-prima.fr Stability : experimental Portability : unknown

Synopsis

Default Main

defaultMain Source

Arguments

:: CLIContext

A collection of commands

-> IO () 

CLI

class CLI cli where Source

Methods

name :: cli -> String Source

desc :: cli -> String Source

options :: cli -> [OptHelp] Source

action :: cli -> CLIContext -> [String] -> IO () Source

Instances

Default CLIs

data Usage Source

Default usage Command Interface

Instances

printUsage Source

Arguments

:: String

indentation

-> String

program name

-> CLIContext

the command to print

-> String 

Pretty printer: list the available commands

data Help Source

Constructors

Help 

Instances

printHelp Source

Arguments

:: String

indentation

-> String

program name

-> CLIContext

command list

-> String 

Commands

initialize Source

Arguments

:: CLI cliDefault 
=> Maybe cliDefault

The command to execute if no option is given

-> String

CLI Description

-> CLIContext 

Initialize a collection of commands

with Source

Arguments

:: CLI cli 
=> cli

A new Command Interface

-> CLIContext

The original Collection of commands

-> CLIContext 

Add a new Command into a collection of commands