Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bates64/wren-args
Simple command line arguments parser for Wren
https://github.com/bates64/wren-args
wren
Last synced: 14 days ago
JSON representation
Simple command line arguments parser for Wren
- Host: GitHub
- URL: https://github.com/bates64/wren-args
- Owner: bates64
- Created: 2018-01-22T18:18:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-22T18:19:58.000Z (almost 7 years ago)
- Last Synced: 2024-10-22T07:03:28.353Z (2 months ago)
- Topics: wren
- Homepage:
- Size: 1000 Bytes
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wren-args
Super-simple command-line arguments parser for [Wren](https://github.com/munificent/wren).```dart
import "args" for Argsvar args = Args.parse()
if (args["special-mode"]) System.print("Special mode activated!")
```### Args.parse(List args) -> List
Parses a list of strings like `Process.arguments`.```dart
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`.