1.2.1 • Published 4 years ago

yaclip v1.2.1

Weekly downloads
8
License
ISC
Repository
github
Last release
4 years ago

Yet another command line parser. This one supports subcommands though.

Usage

const parseCommandLine = require("yaclip");

const subcommands = [
    { name: 'subcommand', alias: "s", type: String, multiple: false},
]

const commands = [
    { name: 'command', alias: "c", type: String, multiple: false, subcommands},
    { name: 'other', alias: "0", type: String, multiple: false}
];

const arguments = parseCommandLine(commands);
console.log(arguments);
node example.js \
    --command "This is the command" \
    --subcommand "this goes in the subsection of command" \
    --other "this is parsed nicely"

It has limitations, I built it for bounce.

Dash optionality

If you prefer your commands without dashes, specify option dashesAreOptional to true when instantiating the parser:

const arguments = parseCommandLine(commands, { dashesAreOptional: true });
console.log(arguments);
node example.js \
    command "This is the command" \
    --subcommand "this goes in the subsection of command" \
    other "this is parsed nicely"
1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago