Skip to content

Commit

Permalink
feat: The mocker command add help parameters. #144
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 27, 2020
1 parent 259c2a0 commit a4895b6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/core/src/bin/mocker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ interface MockerConfig {
const DEFAULTMOCKPATH = './mock';

const argvs = minimist(process.argv.slice(2));

if (argvs.h || argvs.help) {
console.log('\n Usage: mocker <path> [--config] [--help|h]')
console.log('\n Displays help information.')
console.log('\n Options:')
console.log(' --config <path>', 'Simple configuration')
console.log('\n Example:')
console.log(' mocker mock/index.js')
console.log(' mocker mock/m1.js test/m2.js')
console.log(' mocker mock/m1.js --config mocker.config.json')
return;
}

const paths = argvs['_'];

let mockPath = paths || DEFAULTMOCKPATH;
Expand Down

0 comments on commit a4895b6

Please sign in to comment.