Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pixeldroid/optionparser-ls
a simple option parser for Loom commandline apps
https://github.com/pixeldroid/optionparser-ls
argument-parser cli commandline-apps library loomlib loomscript option option-parser optionparser-library
Last synced: about 1 month ago
JSON representation
a simple option parser for Loom commandline apps
- Host: GitHub
- URL: https://github.com/pixeldroid/optionparser-ls
- Owner: pixeldroid
- License: other
- Created: 2015-01-03T18:26:21.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-09-19T02:38:24.000Z (over 7 years ago)
- Last Synced: 2023-03-12T07:11:22.555Z (almost 2 years ago)
- Topics: argument-parser, cli, commandline-apps, library, loomlib, loomscript, option, option-parser, optionparser-library
- Language: LoomScript
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
optionparser-ls
===============a simple option parser for [Loom][loom-sdk] commandline apps
- [installation](#installation)
- [usage](#usage)
- [building](#building)
- [contributing](#contributing)## installation
Download the library into its matching sdk folder:
$ curl -L -o ~/.loom/sdks/sprint34/libs/OptionParser.loomlib \
https://github.com/pixeldroid/optionparser-ls/releases/download/v2.1.1/OptionParser-sprint34.loomlibTo uninstall, simply delete the file:
$ rm ~/.loom/sdks/sprint34/libs/OptionParser.loomlib
## usage
0. declare a reference to the OptionParser loomlib in your `.build` file:
```ls
"references": [
"System",
"OptionParser"
],
```
0. import `pixeldroid.cli.OptionParser`
0. instantiate a new `pixeldroid.cli.OptionParser` and call the `parse()` method on it
0. retrieve `pixeldroid.cli.Option` items via the `getOption()` method of OptionParser### OptionParserDemo
see an example of using the OptionParser here:
* [OptionParserDemoCLI.build][OptionParserDemoCLI.build]
* [OptionParserDemoCLI.ls][OptionParserDemoCLI.ls]you can compile and run the demo from the command line:
$ cd test
$ ~/.loom/sdks/sprint34/bin/osx-x64/tools/lsc OptionParserDemoCLI.build
$ mv bin/OptionParserDemoCLI.loom bin/Main.loom
$ ~/.loom/sdks/sprint34/bin/osx-x64/tools/loomexec // --help
$ ~/.loom/sdks/sprint34/bin/osx-x64/tools/loomexec // --optionA arg1 arg2 -bor use Rake:
$ rake cli['--optionA arg1 arg2 -b']
## building
first, install [loomtasks][loomtasks] and the [spec-ls library][spec-ls]
### compiling from source
$ rake lib:install
this will build the OptionParser library and install it in the currently configured sdk
### running tests
$ rake test
this will build the OptionParser library, install it in the currently configured sdk, build the test app, and run the test app.
## contributing
Pull requests are welcome!
[loom-sdk]: https://github.com/LoomSDK/LoomSDK "a native mobile app and game framework"
[loomtasks]: https://github.com/pixeldroid/loomtasks "Rake tasks for working with loomlibs"
[OptionParserDemoCLI.build]: ./cli/src/OptionParserDemoCLI.build "build file for the demo"
[OptionParserDemoCLI.ls]: ./cli/src/demo/OptionParserDemoCLI.ls "source file for the demo"
[spec-ls]: https://github.com/pixeldroid/spec-ls "a simple spec framework for Loom"