Java Code Examples for org.aesh.terminal.utils.Config#getLineSeparator()

The following examples show how to use org.aesh.terminal.utils.Config#getLineSeparator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AliasManager.java    From aesh-readline with Apache License 2.0 6 votes vote down vote up
public String removeAlias(String buffer) {
    if(buffer.trim().equals(UNALIAS))
        return unaliasUsage();
    if (unaliasHelpPattern.matcher(buffer).matches())
        return unaliasUsage();

    buffer = buffer.substring(UNALIAS.length()).trim();

    for(String s : buffer.split(" ")) {
        if(s != null) {
            Optional<Alias> a = getAlias(s.trim());
            if(a.isPresent()) {
                aliases.remove(a.get());
            }
            else
                return "unalias: "+s+": not found" +Config.getLineSeparator();
        }
    }
    return null;
}
 
Example 2
Source File: HelpSupport.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private static String getAdaptedArgumentDescription(ModelNode mn) {
    String desc = mn.get(Util.DESCRIPTION).asString();
    if (mn.hasDefined(Util.FILESYSTEM_PATH) && mn.hasDefined(Util.ATTACHED_STREAMS)) {
        desc = "The path to the file to attach."
                + " The CLI deals directly with file paths and doesn't "
                + "require index manipulation." + Config.getLineSeparator()
                + "NB: The actual argument type is "
                + mn.get(Util.TYPE).asType();
    }
    return desc;
}
 
Example 3
Source File: AliasManager.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
public String aliasUsage() {
    return "alias: usage: alias [name[=value] ... ]"+Config.getLineSeparator();
}
 
Example 4
Source File: AliasManager.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
public String unaliasUsage() {
    return "unalias: usage: unalias name [name ...]"+Config.getLineSeparator();
}