MCPcopy
hub / github.com/thinkjs/thinkjs / parseArgv

Method parseArgv

lib/application.js:91–104  ·  view source on GitHub ↗

* parse argv

()

Source from the content-addressed store, hash-verified

89 * parse argv
90 */
91 parseArgv() {
92 const options = {};
93 const argv2 = process.argv[2];
94 const portRegExp = /^\d{2,5}$/;
95 const pathRegExp = /^\/?[a-z]\w*/i;
96 if (argv2) {
97 if (pathRegExp.test(argv2)) {
98 options.path = argv2;
99 } else if (portRegExp.test(argv2)) {
100 options.port = argv2;
101 }
102 }
103 return options;
104 }
105 _getMasterInstance(argv) {
106 const port = argv.port || think.config('port');
107 const host = think.config('host');

Callers 2

runMethod · 0.95
application.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected