This package has been deprecated

Author message:

Since v7.0.0, yargs supports default commands natively

yargs-default-command

1.0.2 • Public • Published

yargs-default-command

A plugin for yargs which allows adding a default command that will match if called without a command or no other command matches.

Install

npm install --save yargs-default-command

Example

index.js:

#!/usr/bin/env node
 
var yargs = require('yargs');
var args = require('yargs-default-command')(yargs);
 
args
  .command('*', 'default command', function(yargs) {
    console.log('DEFAULT');
  })
  .command('build', 'build command', function(yargs) {
    console.log('BUILD');
  })
  .args;

Output:

$ ./index.js build
BUILD

$ ./index.js foo
DEFAULT

$ ./index.js
DEFAULT

Readme

Keywords

none

Package Sidebar

Install

npm i yargs-default-command

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • axtgr