m-cli-builder

1.0.0 • Public • Published

Install

npm i m-cli-builder

Usage

const mclib = require("m-cli-builder")(
    "Default message title",
    "Default message description",
    "--" // prefix
);

mclib.add("
    command", // command's name
    "description", // command's description
    false // required?
);

// check if user used "test" argument (--test)
if(mclib.args["test"]) {
    console.log("You used --test !");
}

// see more details about the arguments
console.log(mclib.args);

mclib.check(); // check if user used all required arguments

U can use --command=<detail> <more details> for example: --send=true Hello from mclib! --type=message

{
    "send": {
        "text": "Hello from mclib!",
        "description": "true",
        "name": "--send"
    },
    "type": {
        "text": "",
        "description": "message",
        "name": "--type"
    },
}

Readme

Keywords

Package Sidebar

Install

npm i m-cli-builder

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

3.35 kB

Total Files

3

Last publish

Collaborators

  • miftikcz