Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
The obvious CLI specification format. You define the spec, Oclis generates the code! Support for PureScript so far. PRs for more languages appreciated!
License
Airsequel/Oclis
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
CLI (Command Line Interface) app builderbased on a simple, obvious specification file.
Building a CLI application is a repetitive task.The same code is written over and over again.But fear not, Oclis is here to help you out!
cargo install oclisoclis init- Creates anoclis.nclspecifcation file.- Adapt the specification file to your liking.
(Check out theexamples directory for inspiration.) - Run
oclis buildto generate the CLI parsing code
(It automatically detects the main repo language,but only PureScript is supported at the moment.) - Add missing dependencies to your project.
(E.g. for PureScript check out thespago.yaml file.) - Define the handler functions for your commands.
(Check out themain function of Transity for an example.) - Commit the generated code to the repository.
Some features of other CLI frameworks are deliberately not supported:
- Specifying a flag several times. (e.g.
tar -v -v -v)This is error prone as it's easy to accidentally add it several times.Use a numerical verbosity flag instead (e.g.tar -v=3)or define your own counting system (e.g.tar -v=xxx) - Specifying flags/options after the arguments.(e.g.
pandoc in.md --output=out.pdf)Disallowing this helps to prevent errors from accidentally providingan argument which is understood as a flag/option.Suggested alternatives:- Sub-command:
pandoc convert in.md out.pdf - Option first:
pandoc --output=out.pdf in.md - Extra option:
pandoc --input=in.md --output=out.pdf
- Sub-command:
- CLI Definition Language - DSL for defining command line interfacesof C++ programs.
- Decli - Declarative CLI tool builder.
- docopt - Command-line interface description language.
- make-cli - Declarative CLI framework for Node.js.
Check out the repoawesome-cli-frameworksfor a full overview.
- clig.dev - Command Line Interface Guidelines.
- GNU Table of Long Options
- Heroku CLI Style Guide
- OpenAutoComplete - CLI autocomplete specification.
- POSIX Utility Conventions
About
The obvious CLI specification format. You define the spec, Oclis generates the code! Support for PureScript so far. PRs for more languages appreciated!
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.