MCPcopy
hub / github.com/brunch/brunch / checkForRemovedOptions

Function checkForRemovedOptions

lib/cli.js:68–82  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

66 .action(wrapCommand('watch'));
67
68var checkForRemovedOptions = function(args) {
69 var pIndex = args.indexOf('-p');
70 if (pIndex !== -1) {
71 // if -p is followed by a number, the user probably wants to specify the port
72 // the new option name for port is -P
73 var port = +args[pIndex + 1];
74 if (Number.isInteger(port)) {
75 var parsed = args.slice(2).map(function(arg) {
76 return arg === '-p' ? '-P' : arg;
77 });
78 var corrected = ['brunch'].concat(parsed).join(' ');
79 return 'The `-p` option is no longer used to specify the port. Use `-P` instead, e.g. `' + corrected + '`';
80 }
81 }
82};
83
84// The fn would be executed every time user run `bin/brunch`.
85exports.run = function() {

Callers 1

cli.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…