https://github.com/pouyakary/clavinet
An independent "Command Line Argument" language based on the tokens recived from process.argv
https://github.com/pouyakary/clavinet
argv command-line-parser kary-comments karyfoundation pegjs
Last synced: 7 days ago
JSON representation
An independent "Command Line Argument" language based on the tokens recived from process.argv
- Host: GitHub
- URL: https://github.com/pouyakary/clavinet
- Owner: pouyakary
- License: mpl-2.0
- Created: 2017-11-13T14:05:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-13T15:05:47.000Z (over 7 years ago)
- Last Synced: 2025-01-17T09:53:29.402Z (4 months ago)
- Topics: argv, command-line-parser, kary-comments, karyfoundation, pegjs
- Language: TypeScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clavinet
Clavinet is a command line argument parser with it's own language rules. It joins the given `process.argv` into a string and then parses it with it's own language grammar.## Language
Clavinet has these concepts:- __Commands__ — Commands start with double dashes as `--some-command-name` and they can have a value after them separated by spaces like: `--say hello`, or `--add [2, 3, 5]`
- __Values__ — Values are __Literals__ or __Arrays__
- __Array__ — Array is made of a sequence of __Values__ separated by `,` and inside of square bracket. For example: `[1, 2, 4, hello, [1, 3]]`
- __Literals__ — Literals are numbers and words in this format: `[a-zA-Z0-9_\./][a-zA-Z0-9_\.\-/]*`## Building
You need to run `npm install` to install all the dependencies and you must have _TypeScript_ installed on your system. After that you can build the package using```
npm run build
```## How to use it?
First install it via
```sh
npm install --save clavinet
```Then use it as:
```js
const clavinet = require('clavinet')
const args = clavinet.Parse( )
```