Skip to content

Commit 173f2bd

Browse files
authored
Merge pull request #9 from nschlimm/feature/menu-nicely
Feature/menu nicely
2 parents 2b0db7e + a53a16a commit 173f2bd

File tree

11 files changed

+102
-94
lines changed

11 files changed

+102
-94
lines changed

EasyKey.git/ezk-git-atuc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function resetToCommitHard () {
4747
while ${continuemenu:=true}; do
4848
clear
4949
menuInit "Undoing changes"
50-
coloredLog " ALWAYS PREFER REVERT " "$clrPurple" "$clrWhite"
50+
coloredLog " ALWAYS PREFER REVERT " "$clrPurple" "$clrWhite" && printf "\n\r"
5151
submenuHead "Undoing changes"
5252
menuItem a "Revert last commit - (keep commit history - create new commit)" revertLastCommit
5353
menuItem b "Revert commit - (keep commit history - create new commit)" revertToCommit

EasyKey.git/ezk-git-diff.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ diffStatus() {
9191
echo "Note: GIT diff cann compare four locations with each other: "
9292
echo " your working directory, the stage, the repository."
9393
echo
94-
coloredLog "┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐" "$clrPurple" "$clrBlack"
95-
coloredLog "│ │ │ │ │ │ │ │" "$clrPurple" "$clrBlack"
96-
coloredLog "│ │ -> │ │ -> │ │ -> │ │" "$clrPurple" "$clrBlack"
97-
coloredLog "└────────┘ └────────┘ └────────┘ └────────┘" "$clrPurple" "$clrBlack"
98-
coloredLog " work dir stage local repo remote repo" "$clrWhite" "$clrBlack"
94+
coloredLog "┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐" "$clrPurple" "$clrBlack" && printf "\n\r"
95+
coloredLog "│ │ │ │ │ │ │ │" "$clrPurple" "$clrBlack" && printf "\n\r"
96+
coloredLog "│ │ -> │ │ -> │ │ -> │ │" "$clrPurple" "$clrBlack" && printf "\n\r"
97+
coloredLog "└────────┘ └────────┘ └────────┘ └────────┘" "$clrPurple" "$clrBlack" && printf "\n\r"
98+
coloredLog " work dir stage local repo remote repo" "$clrWhite" "$clrBlack" && printf "\n\r"
9999
}
100100

101101
git fetch --all

EasyKey.git/ezk-git-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function mergeChanges () {
8181
echo "... nothing to merge ..."
8282
elif [ $behind_count -gt 0 ]; then
8383
echo "Your current branch '$current_branch' is behind of its remote counterpart."
84-
coloredLog " MERGE RECOMMENDED " "$clrPurple" "$clrWhite"
84+
coloredLog " MERGE RECOMMENDED " "$clrPurple" "$clrWhite" && printf "\n\r"
8585
diffDrillDownAdvanced "git diff --name-status origin/$actual $actual" "awk '{print \$2}'" "origin/$actual" "$actual"
8686
executeCommand "git diff --name-status origin/$actual $actual"
8787
read -p "Merge (y/n)? " -n 1 -r

EasyKey.git/ezk-git-loca.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

33
oldmenudata=("${menudatamap[@]}")
4+
old_calculatedMenuWidth=$calculatedMenuWidth
5+
old_globalClmWidth=$globalClmWidth
46

57
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
68
source "$script_dir/../shellmenu.sh"
@@ -63,12 +65,14 @@ for (( i = 0; i < ${#gitlocations[@]}; i++ )); do
6365
IFS=$IFSOLD
6466
menuItem "${arrIN[0]}" "${arrIN[1]}" "${arrIN[2]} ${arrIN[3]}"
6567
done
66-
if $uncached; then coloredLog "NEW" "1;42"; else coloredLog "CACHED" "1;42"; fi
68+
if $uncached; then coloredLog "NEW" "1;42" && printf "\n\r"; else coloredLog "CACHED" "1;42" && printf "\n\r"; fi
6769
submenuHead "Shortcuts"
6870
menuItem X "Purge git dir cache" purgDirCache
6971
startMenu
7072

7173
source "$script_dir/../shellmenu.sh"
7274
menudatamap=("${oldmenudata[@]}")
75+
calculatedMenuWidth=$old_calculatedMenuWidth
76+
globalClmWidth=$old_globalClmWidth
7377

7478
noterminate

EasyKey.git/ezk-git-objects.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
shopt -s nullglob extglob
4+
5+
cd "`git rev-parse --git-path objects`"
6+
7+
# packed objects
8+
for p in pack/pack-*([0-9a-f]).idx ; do
9+
git show-index < $p | cut -f 2 -d ' '
10+
done
11+
12+
# loose objects
13+
for o in [0-9a-f][0-9a-f]/*([0-9a-f]) ; do
14+
echo ${o/\/}
15+
done

EasyKey.git/git.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ globalClmWidth=35
1313
git fetch --all --tags 2> /dev/null
1414

1515
menuInit "EasyKey.git"
16-
submenuHead "Working with remotes:"
16+
submenuHead "Working with remotes "
1717
menuItemClm a "Gently push current" pushActual b "Set remote origin repo" setRemoteOrigin
1818
menuItemClm e "Set upstream to current" setUpstream f "Administer remotes" adminRemotes
19-
submenuHead "Working on local branches:"
19+
submenuHead "Working on local branches "
2020
menuItemClm r "Show branch history" showBranchHisto g "Show reflog" showRepoHisto
2121
menuItemClm v "Checkout remote branch" coRemoteBranch n "Delete local/remote branch" deleteBranch
2222
menuItemClm o "Merge source to target branch" mergeSourceToTarget p "Show all branches (incl. remote)" showAllBranches
2323
menuItemClm k "New local/remote branch checkout" newLocalBranch c "Change last commit message" "git commit --amend"
24-
submenuHead "Other usefull actions:"
24+
submenuHead "Other usefull actions "
2525
menuItemClm s "Working with diffs" workingDiffs w "Working with commits" atlassiansView
2626
menuItemClm y "Setting up repositories" settingUp 5 "Git extras" gitExtras
27-
submenuHead "Git admin actions:"
27+
submenuHead "Git admin actions "
2828
menuItemClm 1 "Show local git config" localGitConfig 2 "Show global git config" globalGitConfig
2929
menuItemClm 3 "Administering aliases" adminAliases 4 "Show .gitignore" gitIgnore
3030
menuItem x "Descrease repo size" repoSize
31-
submenuHead "Shortcuts"
31+
submenuHead "Shortcuts "
3232
menuItemClm P "Change project" changeProject B "Change branch" changeBranch
3333
menuItem F "Fetch all" fetchAll
3434
startMenu "showStatus"

EasyKey.kubectl/kubectl.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@ source "$script_dir/../shellmenu.sh"
99
source "$script_dir/ezk-kubectl-functions.sh"
1010

1111
menuInit "EasyKey.kubectl"
12-
submenuHead "Kubectl Config:" "Test:"
12+
submenuHead "Kubectl Config "
1313
menuItemClm a "Show config" "kubectl config view" b "Switch context" switchContext
1414
menuItemClm c "Switch namespace" switchNamespace d "Add cluster" addCluster
1515
menuItemClm e "Add users (token)" addUsers f "Add context" addContext
1616
menuItemClm g "Edit config" "vim ~/.kube/config" h "Create namespace" createNamespace
17-
submenuHead "Pods:"
17+
submenuHead "Pods "
1818
menuItemClm j "List pods (ns=current)" "kubectl get pods -o wide" k "List pods (all namespaces)" "kubectl get pods --all-namespaces -o wide"
19-
menuItemClm l "Show pod manifest (desired/observed)" showPodManifest m "Describe pod" describePod
19+
menuItemClm l "Show pod manifest" showPodManifest m "Describe pod" describePod
2020
menuItemClm n "Get logs" getPodLogs o "Log on to pod" logOnPod
2121
menuItemClm p "Log on to DB" logOnDb r "Apply pod manifest" applyPodManifest
2222
menuItem s "Delete pod" deletePod
23-
submenuHead "Deployments:"
23+
submenuHead "Deployments "
2424
menuItemClm v "List deployments (ns=current)" "kubectl get deployments -o wide" w "List deployments (all namespaces)" "kubectl get deployments --all-namespaces -o wide"
25-
menuItemClm x "Show deployment manifest (desired/observed)" showDeploymentManifest y "Describe deployment" describeDeployment
25+
menuItemClm x "Show deployment manifest" showDeploymentManifest y "Describe deployment" describeDeployment
2626
menuItemClm z "List replicasets (ns=current)" "kubectl get rs -o wide" 1 "Describe replica set" describeReplicaset
2727
menuItemClm 2 "Redeploy" redeploy 3 "Deployment history" deplHist
2828
menuItemClm 4 "Undo deployment" rollbackDeployment 5 "Deployment status" deployState
2929
menuItem E "Edit deployment" editDeployment
30-
submenuHead "Services:"
30+
submenuHead "Services "
3131
menuItemClm 6 "List services (ns=current)" "kubectl get services -o wide" 7 "List services (all namespaces)" "kubectl get services --all-namespaces -o wide"
32-
menuItemClm 8 "Show service manifest (desired/observed)" showServiceManifest 9 "Describe service" describeService
33-
submenuHead "Other stuff:"
32+
menuItemClm 8 "Show service manifest" showServiceManifest 9 "Describe service" describeService
33+
submenuHead "Other stuff "
3434
menuItemClm I "List images in contexts" listImagesInUse J "Ingress configuration" "kubectl get ing -o json | jq -r '.items[].spec.rules[].http.paths[]'"
3535
menuItemClm K "Describe ingress" "kubectl describe ing" "L" "Edit config map" editConfigMap
3636
menuItem T "Edit Ingress" "kubectl edit ingress"

EasyKey.maven/maven.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source "$script_dir/ezk-maven-functions.sh"
1111
globalClmWidth=20
1212

1313
menuInit "Super MAVEN Home"
14-
submenuHead "Maven:"
14+
submenuHead "Working with Maven POM "
1515
menuItemClm a "Clean all eclipse" "mvnCleanEclipse" b "Maven analyze dependencies" "mvn dependency:analyze"
1616
menuItemClm c "Clean install force updates" "mvn clean install -U -DskipTests" d "To maven repo" toRepo
1717
menuItemClm e "Show effective settings" "mvn help:effective-settings" f "Local repo location" "mvn help:evaluate -Dexpression=settings.localRepository | grep -v '\[INFO\]'"
@@ -20,11 +20,11 @@ menuInit "Super MAVEN Home"
2020
menuItemClm k "Download sources" downLoadSources l "Build with deps" "mvn clean compile assembly:single"
2121
menuItemClm m "New project from archetype" newProject p "Effective pom" "mvn help:effective-pom"
2222
menuItemClm t "Dependency tree" "mvn dependency:tree" u "Display dependency updates" "mvn versions:display-dependency-updates -DexcludeReactor=true"
23-
submenuHead "Lifecycle:"
23+
submenuHead "Lifecycle "
2424
menuItemClm C "Clean compile" "mvn clean compile" T "Clean test" "mvn clean test"
2525
menuItemClm I "Clean install" "mvn clean install -DskipTests" P "Clean package" "mvn clean package -DskipTests"
2626
menuItem D "Clean deploy" "mvn clean deploy -DskipTests"
27-
submenuHead "Spring-Boot:"
27+
submenuHead "Spring-Boot "
2828
menuItemClm o "Start Spring Boot App" startSpringBoot s "View application properties" showProperties
2929
menuItem v "Usefull notes" useFull
3030
startMenu "pwd"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ EasyKey.shellmenu is a simple script to generate menus for command execution in
1313
- Use single or double column menu
1414
- Call user-defined shell functions or immediately execute shell command
1515
- Return to menu once command or function completed
16-
- Log executed commands
16+
- Log executed commands
1717

1818
👌 Increase your productivity and relax !
1919

maven_example.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ showGlobalSettingFile() {
2222

2323
clear
2424
menuInit "Maven demo menu"
25-
submenuHead "Life cycle commands:"
25+
submenuHead "Life cycle commands "
2626
menuItem c "Clean all" "mvn clean:clean"
2727
menuItem x "Compile" "mvn clean compile"
2828
menuItem t "Test" "mvn clean test"
2929
menuItem i "Install" "mvn clean install"
30-
submenuHead "Also usefull:"
30+
submenuHead "Also usefull "
3131
menuItem d "Analyze dependencies" "mvn dependency:analyze"
3232
menuItem u "Clean compile force updates" "mvn clean compile -U -DskipTests"
3333
menuItem e "Show effective settings" "mvn help:effective-settings"

0 commit comments

Comments
 (0)