1.0.0 • Published 3 years ago

argy-args v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Argy

A simple command line args and options parser for node.

Installation

$ yarn add argy-args

Usage

import { Argy } from "./argy";

const argy = new Argy();

argy.setAppName("Argy example");

argy.addArgument("volume", {
  prefix: "long",
  takesValue: true,
  required: true,
  callback: (value) => {
    console.log("volume: ", value);
  },
});

argy.addAlias("volume", "vol", { prefix: "short" });

argy.addAutoHelp();

argy.execArguments();

Help example

$ app --help
-- ARGY EXAMPLE - HELP --

  "--volume=value" - No description
  "-vol=value" - Alias to "--volume"
  "--help" - Displays help information

-- ARGY EXAMPLE - HELP --