diff options
author | Reinaldo Colina <rcolina@pingidentity.com> | 2015-08-28 13:55:37 -0700 |
---|---|---|
committer | Reinaldo Colina <rcolina@pingidentity.com> | 2015-08-28 13:55:37 -0700 |
commit | 93dad96832a59d3d7f6ac6580cabf0202b387ffe (patch) | |
tree | 36b91c6061bd049db3d92642d6c89451ea4f13d7 | |
parent | 637b5d5534469ebb15826139e1b3df12a1cc9309 (diff) | |
download | git-sonar-93dad96832a59d3d7f6ac6580cabf0202b387ffe.tar.gz git-sonar-93dad96832a59d3d7f6ac6580cabf0202b387ffe.zip |
Removing --minimal arg implementation
- Dealing with the git: prefix will be done in a separate pull request
- The new --no-remote-status arg remains
-rw-r--r-- | README.md | 15 | ||||
-rwxr-xr-x | prompt.bash | 6 | ||||
-rwxr-xr-x | radar-base.sh | 9 | ||||
-rwxr-xr-x | test-radar-base.sh | 23 |
4 files changed, 1 insertions, 52 deletions
@@ -137,21 +137,6 @@ export PS1="$PS1\$(git-radar --bash --fetch)" export PROMPT="$PROMPT$(git-radar --zsh --fetch) " ``` -### (Optional) Minimal mode - -If you wish to keep the length of your prompt shorter, you can call git-radar with `--minimal` which will render the new prompt without the `git:` part - -**Bash** -```bash -export PS1="$PS1\$(git-radar --bash --fetch --minimal) " -``` -(note: the `\` escaping the `$` is important) - -**Zsh** -```zsh -export PROMPT="$PROMPT$(git-radar --zsh --fetch --minimal) " -``` - ## License Git Radar is licensed under the MIT license. diff --git a/prompt.bash b/prompt.bash index 1e79cd9..429c88d 100755 --- a/prompt.bash +++ b/prompt.bash @@ -1,15 +1,11 @@ #! /usr/bin/env bash dot="$(cd "$(dirname "$0")"; pwd)" -git_label="" args=$@ source "$dot/radar-base.sh" if is_repo; then - if show_git_label $args; then - git_label="git:" - fi - printf " \x01\033[1;30m\x02$git_label(\x01\033[0m\x02" + printf " \x01\033[1;30m\x02git:(\x01\033[0m\x02" if show_remote_status $args; then bash_color_remote_commits fi diff --git a/radar-base.sh b/radar-base.sh index a2f5115..d019629 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -1,4 +1,3 @@ -IS_MINIMAL='--minimal' NO_REMOTE_STATUS='--no-remote-status' dot_git="" @@ -472,14 +471,6 @@ zsh_color_remote_commits() { printf %s "$remote" } - -show_git_label() { - if [[ $@ == *$IS_MINIMAL* ]]; then - return 1 # don't show the git label - fi - return 0 -} - show_remote_status() { if [[ $@ == *$NO_REMOTE_STATUS* ]]; then return 1 # don't show the git remote status diff --git a/test-radar-base.sh b/test-radar-base.sh index ca95136..9f7f8ee 100755 --- a/test-radar-base.sh +++ b/test-radar-base.sh @@ -2,29 +2,6 @@ scriptDir="$(cd "$(dirname "$0")"; pwd)" source "$scriptDir/radar-base.sh" -test_show_git_label() { - show_git_label - assertTrue $? - - show_git_label --bash - assertTrue $? - - show_git_label --bash --fetch - assertTrue $? - - show_git_label --bash --minimal --fetch - assertFalse $? - - show_git_label --bash --fetch --minimal - assertFalse $? - - show_git_label --minimal --bash --fetch - assertFalse $? - - show_git_label --bash --fetch --minimal --no-remote-status - assertFalse $? -} - test_show_remote_status() { show_remote_status assertTrue $? |