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

The following examples show how to use org.aesh.terminal.utils.Config#getLineSeparator() . These examples are extracted from open source projects. 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 Project: aesh-readline   File: AliasManager.java    License: 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
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 Project: aesh-readline   File: AliasManager.java    License: Apache License 2.0 4 votes vote down vote up
public String aliasUsage() {
    return "alias: usage: alias [name[=value] ... ]"+Config.getLineSeparator();
}
 
Example 4
Source Project: aesh-readline   File: AliasManager.java    License: Apache License 2.0 4 votes vote down vote up
public String unaliasUsage() {
    return "unalias: usage: unalias name [name ...]"+Config.getLineSeparator();
}