解析命令行参数
@param {Array} args process.argv数组
510750
function parse(args) {
    let argv = {};
    let _ = [];
    args = args.slice(2);

    for (let i = 0; i < args.length; ++i) {
        let piece = args[i];

        if (piece.charAt(0) !== '-') {
            _.push(piece);
        } else {
            piece = piece.replace(/^-*/, '').split('');
            piece.forEach(c => {
                argv[c] = true;
            });

            if (args[i + 1] && args[i + 1].charAt(0) !== '-') {
                argv[piece.pop()] = args[i + 1];
                ++i;
            }
        }
    }

    argv._ = _;
    return argv;
}
201363
public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        try {
          GraphicalValidator window = new GraphicalValidator();
          window.frame.setVisible(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
  }
65090
public static void main(String[] args) {

//		StdIODialog dialog = new StdIODialog(System.in, System.out, new CommandShell("cmd.exe", new File("C:\\")));
		StdIODialog dialog = new StdIODialog(System.in, System.out, new CommandShell(new String[]{"cmd.exe"}, new File("./")));
		try {
			dialog.open();
		}
		catch (IOException ioe) {
			ioe.printStackTrace();
		}
	}
744749
public void run(String[] args) {
        String context = args.length > 0 ? args[0] : "";
        String action = args.length > 1 ? args[1] : "";
        String option = args.length > 2 ? args[2] : "";

        switch (context) {
            case "server":
                server(action, option);
                break;
            case "version":
                version();
                break;
            default:
                help();
        }
    }
861635
public void run(String[] args) {
		System.out.println("SampleStarter.run(String[])");
		System.out.println("- args.length: " + args.length);
		for (String arg : args) System.out.println("  - " + arg);
		System.out.println(this);
	}
979198
public static void main(final String[] args) {
    GUIUtil.logUncaughtExceptions(LOG);
    GUIUtil.setLookAndFeel();
    OutputStep.setDefaultHandlerVisualizer();

    javax.swing.SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        try {
          final MultiStepGUI gui = new MultiStepGUI();
          gui.run();
          if(args != null && args.length > 0) {
            gui.setParameters(new SerializedParameterization(args));
          }
          else {
            gui.setParameters(new SerializedParameterization());
          }
        }
        catch(Exception | Error e) {
          // Restore error handler, as the GUI is likely broken.
          LoggingConfiguration.replaceDefaultHandler(new CLISmartHandler());
          LOG.exception(e);
        }
      }
    });
  }
838366
function entry(args) {
    // 序列化请求参数，使之成为一个对象
    // https://www.npmjs.com/package/minimist
    args = minimist(process.argv.slice(2));

    // 初始化 MockStar
    const mockstar = new MockStar(args);
    const log = mockstar.log;

    // 校验
    if (!check(mockstar)) {
        process.exit(2);
    }

    // 初始化
    return mockstar.init([
        internalPluginConsole,
        internalPluginStart,
        internalPluginRun,
        internalPluginStatus,
        internalPluginStop,
        internalPluginInit
    ])
        .then(function () {
            let cmd = args._.shift();

            if (args.v || args.version) {
                cmd = 'version';
            } else if (args.h || args.help) {
                cmd = 'help';
            } else if (args.i || args.info) {
                cmd = 'info';
            } else if (!cmd) {
                cmd = 'info';
            } else if (!mockstar.cmd.get(cmd)) {
                cmd = 'help';
            }

            return mockstar.call(cmd, args)
                .then(function () {
                })
                .catch(function (err) {
                    console.log(err);
                });
        })
        .catch((err) => {
            if (err) {
                log.fatal(err);
            }

            process.exit(2);
        });
}
118426
private void run(String[] args) {
        if (args.length != 2) {
            usage();
        }
        
        System.out.println("Opening Doradus server: " + args[0] + ":" + args[1]);
        try (DoradusClient client = new DoradusClient(args[0], Integer.parseInt(args[1]))) {
            deleteApplication(client);
            createApplication(client);
            addData(client);
            queryData(client);
            deleteData(client);
        }
    }
917849
function execute(cmd, args, cb) {
  if(typeof args === 'function') {
    cb = args;
    args = null;
  }
  var arr = [cmd].concat(args || []);
  if(typeof cb === 'function') {
    this.once('reply', cb);
  }

  // sending over tcp
  if(this.tcp) {
    this.encoder.write(arr);
  // connected to a server within this process
  }else{
    this.socket.write(arr);
  }
}
414631
public static void main(String[] args) {
        JavapTask t = new JavapTask();
        int rc = t.run(args);
        System.exit(rc);
    }
84182
public static void main( String[] args)
    {
    int exitCode = 0;
    try
      {
      ReducerCommand reducer = new ReducerCommand();
      reducer.run( new Options( args));
      }
    catch( Exception e)
      {
      exitCode = 1;
      e.printStackTrace( System.err);
      }
    finally
      {
      System.exit( exitCode);
      }
    }
275
public static void main(String[] args) {
    System.err.println(toString(new int[] { Integer.parseInt(args[0]) }));
  }
772391
function runCmd(cmd, args, fn) {
    args = args || [];
    let runner = require('child_process').spawn(cmd, args, {
        // keep color
        stdio: 'inherit',
    });
    runner.on('close', function(code) {
        if (fn) {
            fn(code);
        }
    });
}
574527
function parseArgv() {
  const args = {}
  for (const arg of process.argv) {
    const elems = arg.split('=')
    const key = elems[0]
    const val = elems.length > 1 ? elems[1] : true
    args[key] = val
  }
  return args
}
199033
public void run(CallURL args) {

        logger = LoggerUtil.getStandardLogger();
        logger.info("Calling ProcessSlaScheduledJob");
        TransactionWrapper transaction = null;
        EngineDataAccessDB edao = new EngineDataAccessDB();
        SimpleDateFormat sdfStatDate = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        try {
            transaction = edao.startTransaction();
            //long dbtime = getDatabaseTime();
            long dbtime =DatabaseAccess.getCurrentTime();
            Calendar systcalendar = Calendar.getInstance();
            systcalendar.setTimeInMillis(dbtime);

            for (Process processVO : ProcessCache.getAllProcesses()) {
                int sla = 0;
                processVO = ProcessCache.getProcess(processVO.getId());
                if ((processVO.getAttribute("SLA") != null && processVO.getAttribute("SLA") != "")) {

                    sla = Integer.parseInt(processVO.getAttribute("SLA"));
                    boolean dealyHandlerDefined = false;
                    if (sla > 0) {
                        List <Process> subProcess = processVO.getSubprocesses();
                        for (Process sProcess : subProcess){
                            if(sProcess.getName().contains("Delay Handler")){
                                dealyHandlerDefined = true;
                                if (dealyHandlerDefined) break;
                            }
                        }
                      if (dealyHandlerDefined){
                        ArrayList<ProcessInstance> listProcessVo = getProcessInstances(processVO.getId());

                        for (ProcessInstance tempProcessVO : listProcessVo) {

                            String processStartDate = tempProcessVO.getStartDate();
                            Date date = sdfStatDate.parse(processStartDate);
                            Calendar processCalendar = Calendar.getInstance();
                            processCalendar.setTimeInMillis(date.getTime());

                            if (ServiceLevelAgreement.INTERVAL_MINUTES.equals(processVO.getAttribute(SLA_UNIT))) {
                                processCalendar.add(Calendar.MINUTE, sla);
                            }
                            else if (ServiceLevelAgreement.INTERVAL_HOURS.equals(processVO.getAttribute(SLA_UNIT))) {
                                processCalendar.add(Calendar.HOUR, sla);
                            }
                            else if (ServiceLevelAgreement.INTERVAL_DAYS.equals(processVO.getAttribute(SLA_UNIT))) {
                                processCalendar.add(Calendar.DATE, sla);
                            }
                            boolean eligibleToProcess = processCalendar.compareTo(systcalendar) < 0;

                            if (eligibleToProcess) {
                                List<ActivityInstance> activityList = tempProcessVO
                                        .getActivities();
                                for (ActivityInstance tempActivityInstanceVO : activityList) {
                                    if (tempActivityInstanceVO.getStatusCode() == WorkStatus.STATUS_WAITING
                                            .intValue()
                                            || tempActivityInstanceVO.getStatusCode() == WorkStatus.STATUS_IN_PROGRESS
                                                    .intValue()) {
                                        InternalEvent event = InternalEvent
                                                .createActivityDelayMessage(tempActivityInstanceVO,
                                                        tempProcessVO.getMasterRequestId());
                                        logger.info("SLA clean event=" + event);
                                        ProcessEngineDriver driver = new ProcessEngineDriver();
                                        driver.processEvents(null, event.toXml());
                                    }

                                }
                            }
                        }
                      }
                    }
                }

            }

        }
        catch (Exception exp) {
            logger.severeException(exp.getMessage(), exp);
        }
        finally {
            try {
                edao.stopTransaction(transaction);
            }
            catch (Exception exp) {
                logger.severeException(exp.getMessage(), exp);
            }
        }
    }
726075
public static ProcessUtils.ProcessResult exec(String [] args)
    throws IOException {
        Process p = Runtime.getRuntime().exec(args);
        ProcessUtils pu = new ProcessUtils();
        // Gobble up any output.
        StreamGobbler err = pu.new StreamGobbler(p.getErrorStream(), "stderr");
        err.setDaemon(true);
        err.start();
        StreamGobbler out = pu.new StreamGobbler(p.getInputStream(), "stdout");
        out.setDaemon(true);
        out.start();
        int exitVal;
        try {
            exitVal = p.waitFor();
        } catch (InterruptedException e) {
            throw new IOException("Wait on process " + Arrays.toString(args) + " interrupted: "
                + e.getMessage());
        }
        ProcessUtils.ProcessResult result =
            pu.new ProcessResult(args, exitVal, out.getSink(), err.getSink());
        if (exitVal != 0) {
            throw new IOException(result.toString());
        } else if (LOGGER.isLoggable(Level.INFO)) {
            LOGGER.info(result.toString());
        }
        return result;
    }
980720
public void process(String[] args, T state) {
    process(new ArrayQueue<String>(args), state);
  }