code: public static void main(String[] args) {
      org.apache.hadoop.hdfs.DnsMonitorSecurityManager.setTheManager();
      int res = -1;
  
      // parse arguments
      Options opts = new Options();
      CommandLine commandLine = null;
      try {
        commandLine = parseArgs(opts, args);
      } catch (IllegalArgumentException iae) {
        commandLine = null;
      }
  
      if (commandLine == null) {
        // invalid arguments
        err("Invalid args");
        printUsage(opts);
        System.exit(-1);
      }
  
      JMXGet jm = new JMXGet();
  
      if (commandLine.hasOption("port")) {
        jm.setPort(commandLine.getOptionValue("port")); 
      }
      if (commandLine.hasOption("service")) {
        jm.setService(commandLine.getOptionValue("service")); 
      }
      if (commandLine.hasOption("server")) {
        jm.setServer(commandLine.getOptionValue("server")); 
      }
  
      if (commandLine.hasOption("localVM")) {
        // from the file /tmp/hsperfdata*
        jm.setLocalVMPid(commandLine.getOptionValue("localVM"));
      }
  
      if (commandLine.hasOption("help")) {
        printUsage(opts);
        System.exit(0);
      }
  
      // rest of args
      args = commandLine.getArgs();
  
      try {
        jm.init();
  
        if (args.length == 0) {
          jm.printAllValues();
        } else {
          for (String key: args) {
            err("key = " + key);
            String val = jm.getValue(key);
            if (val!=null)
              System.out.format(JMXGet.format,key,val);
          }
        }
        res = 0;
      } catch (Exception  re) {
        re.printStackTrace();
        res = -1;
      }
  
      System.exit(res);
    }
docs: main
  @param args