1.3.1 • Published 5 years ago

help-parser v1.3.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Help-Parser parse command output

Travis npm package

Help-Parser

parse any unix standard help output (from running -h/--help)

Check it out

Help-Parser

Installing and using

npm install help-parser
const parseHelpOutput = require('help-parser')

const doc =`
Usage:
  node [--statistics] [--count] [--benchmark] PATH...
  node --version

Options:
  -h --help            show this help message and exit
  --version            show version and exit
  -v --verbose         print status messages
  -q --quiet           report only file names
  -r --repeat          show all occurrences of the same error
  --exclude=PATTERNS   exclude files or directories[default: .svn,CVS,.bzr,.hg,.git]

`;

const help = parseHelpOutput(doc, 'node');
console.log(help)

gives

{ cmdName: 'node',
  usage:
   [ 'Usage:',
     'node [--statistics] [--count] [--benchmark] PATH...',
     'node --version' ],
  args:{
     '--help': { alias: '-h', doc: 'show this help message and exit' },
     '--version': { alias: null, doc: 'show version and exit' },
     '--verbose': { alias: '-v', doc: 'print status messages' },
     '--quiet': { alias: '-q', doc: 'report only file names' },
     '--repeat': { alias: '-r', doc: 'show all occurrences of the same error' },
     '--exclude':{
        alias: null,
        doc:
         'exclude files or directories[default: .svn,CVS,.bzr,.hg,.git]'
      }
  }
}

or clone the git repo and help develop and add to this project

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago