Skip to content

bates64/wren-args

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

wren-args

Super-simple command-line arguments parser for Wren.

import "args" for Args

var args = Args.parse()

if (args["special-mode"]) System.print("Special mode activated!")

Args.parse(List args) -> List<Map args, List loneValues>

Parses a list of strings like Process.arguments.

Args.parse([ "lone", "-dc", "--with", "value" ]) = [
  {
    // 'true' denotes the arguments were provided, but had no value assigned.
    "d": true,
    "c": true,

    // Note that all argument values are returned as Strings. Use Num.fromString
    // to obtain number values, if required.
    "with": "value"
  },

  // Lone values. These are values that had no preceeding argument name before them.
  [ "lone" ]
]

Args.parse()

Calls Args.parse(args) with Process.arguments.

About

Simple command line arguments parser for Wren

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published