https://github.com/bates64/wren-args
Simple command line arguments parser for Wren
https://github.com/bates64/wren-args
wren
Last synced: 5 months 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-22T18:19:58.000Z (over 8 years ago)
- Last Synced: 2025-02-03T13:45:07.275Z (over 1 year 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 Args
var 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`.