MyNixOS website logo
Description

Parse command-line arguments.

Full-featured command-line argument parsing library.

parseargs: Command-line argument parsing for Haskell programs

Copyright (c) 2007 Bart Massey

This library provides System.Console.Parseargs, a module to assist in argument parsing for Haskell stand-alone command line programs.

The package provides a Haskell command-line argument "parser". You supply a specification of the arguments to your command-line program; parseargs reads the arguments and checks that they meet your spec. It then fills in a data structure that captures the relevant data, from which parsed arguments can be extracted as needed. See the Haddock documentation for the gory details.

I have used this code with ghc 6 and later on Linux. It is a fairly standard Hackage-ready package, to the extent I know how to construct such.

This library is not what I set out to build. It definitely could also use some work. However, I use it all the time for writing little programs. I thought others might find it useful, and I also have released other code that depends on it, so I put it out there.

Have fun with it, and let me know if there are problems.

Release History

  • The 0.1.2 release includes a typeclass for argument types for easier use.

  • The 0.1.3 release includes more uniform and usable error handling.

  • The various 0.1.3.x point releases include bug fixes and various extra-minor enhancements. See the Git log.

  • The 0.1.4 release includes the ability to mix optional and required positional arguments.

  • The 0.1.5 release includes the "soft dash" option, giving the ability to allow positional arguments to begin with a dash if possible.

  • The 0.1.5.1 release fixes some warnings and stuff.

  • The 0.1.5.2 release fixes some missing documentation.

  • The 0.2 release cleans up some namespace pollution by removing ArgRecord and the args accessor from the public namespace. This allows the use of the name args by the user to describe program arguments.

  • The 0.2.0.1 release cleans up a bunch of documentation nits and cleans up copyright notices and license information.

  • The 0.2.0.2 release fixes the botched release of 0.2.0.1. Sigh.

  • The 0.2.0.3 release fixes the missing Args constructor documentation of 0.2.0.2.

  • The 0.2.0.4 release suppresses a GHC 7.10 warning for Control.Monad.Safe.

  • Subsequent releases are maintenance for new GHC, Cabal and Stackage stuff.

License

This program is licensed under the "3-clause ('new') BSD License". Please see the file COPYING in this distribution for license terms.

Metadata

Version

0.2.0.9

Executables (1)

  • bin/parseargs-example

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows