MCPcopy Index your code
hub / github.com/prettydiff/prettydiff / args

Function args

services.ts:446–579  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

444 },
445 apps:any = {},
446 args = function node_args():void {
447 const readOptions = function node_args_readOptions():void {
448 const list:string[] = process.argv,
449 def:optionDef = prettydiff.api.optionDef,
450 keys:string[] = (command === "options")
451 ? Object.keys(def.mode)
452 : [],
453 obj = (command === "options")
454 ? def.mode
455 : options,
456 optionName = function node_args_optionName(bindArgument:boolean):void {
457 if (a === 0 || options[list[a]] === undefined) {
458 if (keys.indexOf(list[a]) < 0 && def[list[a]] === undefined) {
459 list.splice(a, 1);
460 len = len - 1;
461 a = a - 1;
462 }
463 return;
464 }
465 if (bindArgument === true && list[a + 1] !== undefined && list[a + 1].length > 0) {
466 list[a] = `${list[a]}:${list[a + 1]}`;
467 list.splice(a + 1, 1);
468 len = len - 1;
469 }
470 list.splice(0, 0, list[a]);
471 list.splice(a + 1, 1);
472 };
473 let split:string = "",
474 value:string = "",
475 name:string = "",
476 a:number = 0,
477 si:number = 0,
478 len:number = list.length;
479 do {
480 list[a] = list[a].replace(/^(-+)/, "");
481 if (list[a] === "verbose") {
482 verbose = true;
483 list.splice(a, 1);
484 len = len - 1;
485 a = a - 1;
486 } else {
487 si = list[a].indexOf("=");
488 if (
489 si > 0 &&
490 (list[a].indexOf("\"") < 0 || si < list[a].indexOf("\"")) &&
491 (list[a].indexOf("'") < 0 || si < list[a].indexOf("'")) &&
492 (si < list[a].indexOf(":") || list[a].indexOf(":") < 0)
493 ) {
494 split = "=";
495 } else {
496 split = ":";
497 }
498 if (list[a + 1] === undefined) {
499 si = 99;
500 } else {
501 si = list[a + 1].indexOf(split);
502 }
503 if (

Callers 1

services.tsFile · 0.85

Calls 1

readOptionsFunction · 0.85

Tested by

no test coverage detected