Created
December 21, 2015 12:22
-
-
Save 4F2E4A2E/96ec03bdd9ac457b5206 to your computer and use it in GitHub Desktop.
Spring Shell Custom Prompt Provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.core.Ordered; | |
import org.springframework.core.annotation.Order; | |
import org.springframework.shell.plugin.support.DefaultPromptProvider; | |
import org.springframework.stereotype.Component; | |
/** | |
* Class to set the CLI Prompt. | |
*/ | |
@Component | |
@Order(Ordered.HIGHEST_PRECEDENCE) | |
public class SpringShellCustomPrompt extends DefaultPromptProvider { | |
/** | |
* Getter for the Prompt. | |
* | |
* @return String | |
*/ | |
@Override | |
public final String getPrompt() { | |
return "$custom-cli>"; | |
} | |
/** | |
* Getter for the Providername. | |
* | |
* @return String | |
*/ | |
@Override | |
public final String getProviderName() { | |
return "Custom prompt provider"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment