cookbook-3.0.1.1: Tiered general-purpose libraries with domain-specific applications.

Safe HaskellSafe
LanguageHaskell98

Cookbook.Recipes.Cline

Synopsis

Documentation

parse :: String -> [Cline] Source #

Parse a flat string into a list of Clines.

data Cline Source #

Module : Cookbook.Recipes.Cline Copyright : (c) 2014 by Nate Pisarski License : BSD3 Maintainer : nathanpisarski@gmail.com Stability : Stable Portability : Portable (Cookbook) Cline is a library for managing strings meant to represent command-line arguments. Flags can toggle functionality in programs. Command-line arguments and their short names take an argument.

Represents command-line options. Works on either arguments or flags.

Constructors

Flag Char 
Argument String String 

Instances

Eq Cline Source # 

Methods

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

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

Show Cline Source # 

Methods

showsPrec :: Int -> Cline -> ShowS #

show :: Cline -> String #

showList :: [Cline] -> ShowS #

clineExtract :: [String] -> [Cline] Source #

Extract arguments from a list of word-separated strings.

clArg :: String -> String Source #

Cleans a command line argument. If it's not a number, it will add a couple of dashes in front of it.