code: public static String[] getServiceName(String[] argv, String[] serviceId) 
        throws IllegalArgumentException {
      ArrayList<String> newArgvList = new ArrayList<String>();
      for (int i = 0; i < argv.length; i++) {
        if ("-service".equals(argv[i])) {
          if (i+1 == argv.length ) {
            throw new IllegalArgumentException("Doesn't have service id");
          }
          serviceId[0] = argv[++i];
        } else {
          newArgvList.add(argv[i]);
        }
      }
      String[] newArgvs = new String[newArgvList.size()];
      newArgvList.toArray(newArgvs);
      return newArgvs;
    }
docs: Get the service name arguments and return the filtered argument list
  @param argv argument list
  @param serviceId[0] is the service id if it's given in the argv, "" otherwise
  @return argument list without service name argument