Skip to content

Flag package

This package provides command-line flag parsing.

{
  "type": "library"
}

Install

{
  "dependencies": {
    "Flag": "pen:///flag"
  } 
}

Flag'Flag module

This module provides command-line flag parsing.

The flags have the following formats:

  • -foo bar: a named flag of a key foo with a value bar
  • foo: a positional flag of a value foo

Named flags and positional flags are separated by -- optionally.

Types

Set

A set of flags

type Set {
  Named {string: string}
  Positional [string]
}

Functions

Parse

Parse flags.

\(ss [string]) Set | error