x/quarrel@v0.5.0

A Deno command line argument parser, highly configurable, and fast (well, not yet)
Latest

Quarrel

A CLI argument parsing utility inspired by Commander.

Installation

Since Quarrel was built for Deno, there is no installation required. Simply add the following code to your modules.

import * as Quarrel from 'https://deno.land/x/quarrel/mod.ts';

Usage

Quarrel is simple to use, and has one main class, for all examples in this document, we will use the import below as reference.

import {Quarrel} from "https://deno.land/x/quarrel/mod.ts";

To get started with your application, you can simply initialise the Quarrel like so:

//lets launch a new Quarrel to handle arguments.
let app = new Quarrel('<app name>', '<app version>');

//now lets make it use the default help response.
app.flag('h', 'help', 'a helpful message');

//And before we finish the snippet, lets run our app.
app.run();

Here is a quick run down of what we just did. In line 2 of the above snippet, we create a new Quarrel instance, this is the backbone of the library and is necessary to have for almost all functionality. Then, on line 5 we assign the flag -h and --help to run the pre-defined help command, featured in this library. On line 8, we instruct the Quarrel to parse, and act on any arguments provided to the application.

Simple enough? Great! Now lets get into the documentation.

Documentation

coming soon...