Prints a suggestion to stderr for the argument based on the levenshtein distance metric

@param arg the argument which could not be assigned to a flag
@param co the {@link ConfigOption} List where every flag is stored
779697
private void printSuggestion( String arg, List<ConfigOption> co ) {
        List<ConfigOption> sortedList = new ArrayList<ConfigOption>( co );
        Collections.sort( sortedList, new ConfigOptionLevenshteinDistance( arg ) );
        System.err.println( "Parse error for argument \"" + arg + "\", did you mean " + sortedList.get( 0 ).getCommandLineOption()
                .showFlagInfo() + "? Ignoring for now." );

    }
440082
public void warning(SourcePosition pos, String key, Object... args) {
        printWarning(pos, getText(key, args));
    }
21036
public void error( Element e, String msg, Object... args ) {
        messager.printMessage( Diagnostic.Kind.ERROR, String.format( msg, args ), e );
    }
1045068
public void printError( Declaration d, String id, Object... args )
    {
        addError( d, id, args );
    }
881189
public static void d(String tag, String msg, Object... args) {
        if (sLevel > LEVEL_DEBUG) {
            return;
        }
        if (args.length > 0) {
            msg = String.format(msg, args);
        }
        Log.d(tag, msg);
    }
209153
public static <T extends CharSequence> T checkArgNotNullOrEmpty(final T arg, final String argNameOrErrorMsg) {
        if (N.isNullOrEmpty(arg)) {
            if (argNameOrErrorMsg.indexOf(' ') == N.INDEX_NOT_FOUND) {
                throw new IllegalArgumentException("'" + argNameOrErrorMsg + "' can not be null or empty");
            } else {
                throw new IllegalArgumentException(argNameOrErrorMsg);
            }
        }

        return arg;
    }
586861
public static void main(String[] args) {
        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.suggestedusers.GetMemberSuggestions [slug]");
            System.exit(-1);
        }
        System.out.println("Showing suggested users in " + args[0] + " category.");
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            ResponseList<User> users = twitter.getMemberSuggestions(args[0]);
            for (User user : users) {
                if (user.getStatus() != null) {
                    System.out.println("@" + user.getScreenName() + " - " + user.getStatus().getText());
                } else {
                    // the user is protected
                    System.out.println("@" + user.getScreenName());
                }
            }
            System.out.println("done.");
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to get suggested users: " + te.getMessage());
            System.exit(-1);
        }
    }
141823
protected static boolean argIsOption(String arg, String option) {
        return arg.equalsIgnoreCase(option) || arg.equalsIgnoreCase('-' + option);
    }
1233855
@Override
    public void warn(Throwable t, String msgFormat, Object... args)
    {
        m_logger.warn(String.format(msgFormat, args), t);
    }
6063
private void printErrorMessage(String key, Object... substitutions) {
        Tr.error(tc, key, substitutions);
        errorMsgIssued = true;
    }
895290
public void error(String message, Object ... args) {
    if (log.isErrorEnabled()) {
      log.error(String.format(message, args));
    }
  }
619028
@Override
    public String usage(final boolean printCommon, final boolean printHidden) {
        final StringBuilder sb = new StringBuilder();

        if (!printHidden) {
            logger.warn("Hidden arguments are always printed in LegacyCommandLineArgumentParser");
        }

        if (prefix.isEmpty()) {
            final String preamble = htmlUnescape(convertFromHtml(getStandardUsagePreamble(callerOptions.getClass()) + getUsagePreamble()));
            checkForNonASCII(preamble, "Tool description");
            sb.append(Utils.wrapParagraph(preamble,OPTION_COLUMN_WIDTH + DESCRIPTION_COLUMN_WIDTH));
            sb.append("\nVersion: " + getVersion());
            sb.append("\n");
            sb.append("\n\nOptions:\n\n");

            for (final String[] optionDoc : FRAMEWORK_OPTION_DOC) {
                printOptionParamUsage(sb, optionDoc[0], optionDoc[1], null, optionDoc[2]);
            }
        }

        if (!optionDefinitions.isEmpty()) {
            optionDefinitions.stream().filter(optionDefinition -> printCommon || !optionDefinition.isCommon).forEach(optionDefinition -> printOptionUsage(sb, optionDefinition));
        }

        if (printCommon) {
            final Field fileField;
            try {
                //Temp class OPTIONS_FILE
                class OptionFileContainerForUsage { public File optionFileContainer;}
                fileField = OptionFileContainerForUsage.class.getField("optionFileContainer");
            } catch (final NoSuchFieldException e) {
                throw new CommandLineException("Should never happen", e);
            }
            final OptionDefinition optionsFileOptionDefinition =
                    new OptionDefinition(fileField, null, OPTIONS_FILE, "",
                            "File of OPTION_NAME=value pairs.  No positional parameters allowed.  Unlike command-line options, " +
                                    "unrecognized options are ignored.  " + "A single-valued option set in an options file may be overridden " +
                                    "by a subsequent command-line option.  " +
                                    "A line starting with '#' is considered a comment.",
                            false, false, 0, Integer.MAX_VALUE, null, true, new String[0]);
            printOptionUsage(sb, optionsFileOptionDefinition);
        }
        return sb.toString();
    }
235425
public void warn(String message, Object ... args) {
    if (log.isWarnEnabled()) {
      log.warn(String.format(message, args));
    }
  }
790353
public void error(String correlationId, String message, Object... args) {
		formatAndWrite(LogLevel.Error, correlationId, null, message, args);
	}
1335253
protected String processOption(DefaultCommandLine cl, String arg) {
        if (arg.length() < 2) {
            return null;
        }

        if (arg.charAt(1) == 'D' && arg.contains("=")) {
            processSystemArg(cl, arg);
            return null;
        }

        arg = (arg.charAt(1) == '-' ? arg.substring(2, arg.length()) : arg.substring(1, arg.length())).trim();

        if (arg.contains("=")) {
            String[] split = arg.split("=");
            String name = split[0].trim();
            validateOptionName(name);
            String value = split[1].trim();
            if (declaredOptions.containsKey(name)) {
                cl.addDeclaredOption(declaredOptions.get(name), value);
            } else {
                cl.addUndeclaredOption(name, value);
            }
            return null;
        }

        validateOptionName(arg);
        if (declaredOptions.containsKey(arg)) {
            cl.addDeclaredOption(declaredOptions.get(arg));
        } else {
            cl.addUndeclaredOption(arg);
        }
        return arg;
    }
343383
private static void validateArguments(String[] args) {
    if (ArrayUtils.isEmpty(args)) {
      System.err.printf("$ java -server ... %s <port>%n", EchoServer.class.getName());
      System.exit(1);
    }
  }
508191
protected int cancel(String[] args) {
		// Parse command line options
		CommandLine line;
		try {
			line = parser.parse(CANCEL_OPTIONS, args, false);
		}
		catch (MissingOptionException e) {
			System.out.println(e.getMessage());
			printHelpForCancel();
			return 1;
		}
		catch (UnrecognizedOptionException e) {
			System.out.println(e.getMessage());
			printHelpForCancel();
			return 2;
		}
		catch (Exception e) {
			return handleError(e);
		}
		
		if (printHelp) {
			printHelpForCancel();
			return 0;
		}
		
		JobID jobId;
		
		if (line.hasOption(ID_OPTION.getOpt())) {
			String jobIdString = line.getOptionValue(ID_OPTION.getOpt());
			try {
				jobId = new JobID(StringUtils.hexStringToByte(jobIdString));
			} catch (Exception e) {
				System.out.println("Error: The value for the Job ID is not a valid ID.");
				printHelpForCancel();
				return 1;
			}
		} else {
			System.out.println("Error: Specify a Job ID to cancel a job.");
			printHelpForCancel();
			return 1;
		}
		
		ExtendedManagementProtocol jmConn = null;
		try {
			jmConn = getJobManagerConnection(line);
			if (jmConn == null) {
				printHelpForCancel();
				return 1;
			}
			
			jmConn.cancelJob(jobId);
			return 0;
		}
		catch (Throwable t) {
			return handleError(t);
		}
		finally {
			if (jmConn != null) {
				try {
					RPC.stopProxy(jmConn);
				} catch (Throwable t) {
					System.out.println("Warning: Could not cleanly shut down connection to the JobManager.");
				}
			}
			jmConn = null;
		}
	}