Skip to content

Commit

Permalink
Merge pull request #9 from nschlimm/feature/menu-nicely
Browse files Browse the repository at this point in the history
Feature/menu nicely
  • Loading branch information
nschlimm authored Mar 25, 2024
2 parents 2b0db7e + a53a16a commit 173f2bd
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 94 deletions.
2 changes: 1 addition & 1 deletion EasyKey.git/ezk-git-atuc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function resetToCommitHard () {
while ${continuemenu:=true}; do
clear
menuInit "Undoing changes"
coloredLog " ALWAYS PREFER REVERT " "$clrPurple" "$clrWhite"
coloredLog " ALWAYS PREFER REVERT " "$clrPurple" "$clrWhite" && printf "\n\r"
submenuHead "Undoing changes"
menuItem a "Revert last commit - (keep commit history - create new commit)" revertLastCommit
menuItem b "Revert commit - (keep commit history - create new commit)" revertToCommit
Expand Down
10 changes: 5 additions & 5 deletions EasyKey.git/ezk-git-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ diffStatus() {
echo "Note: GIT diff cann compare four locations with each other: "
echo " your working directory, the stage, the repository."
echo
coloredLog "┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐" "$clrPurple" "$clrBlack"
coloredLog "│ │ │ │ │ │ │ │" "$clrPurple" "$clrBlack"
coloredLog "│ │ -> │ │ -> │ │ -> │ │" "$clrPurple" "$clrBlack"
coloredLog "└────────┘ └────────┘ └────────┘ └────────┘" "$clrPurple" "$clrBlack"
coloredLog " work dir stage local repo remote repo" "$clrWhite" "$clrBlack"
coloredLog "┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐" "$clrPurple" "$clrBlack" && printf "\n\r"
coloredLog "│ │ │ │ │ │ │ │" "$clrPurple" "$clrBlack" && printf "\n\r"
coloredLog "│ │ -> │ │ -> │ │ -> │ │" "$clrPurple" "$clrBlack" && printf "\n\r"
coloredLog "└────────┘ └────────┘ └────────┘ └────────┘" "$clrPurple" "$clrBlack" && printf "\n\r"
coloredLog " work dir stage local repo remote repo" "$clrWhite" "$clrBlack" && printf "\n\r"
}

git fetch --all
Expand Down
2 changes: 1 addition & 1 deletion EasyKey.git/ezk-git-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function mergeChanges () {
echo "... nothing to merge ..."
elif [ $behind_count -gt 0 ]; then
echo "Your current branch '$current_branch' is behind of its remote counterpart."
coloredLog " MERGE RECOMMENDED " "$clrPurple" "$clrWhite"
coloredLog " MERGE RECOMMENDED " "$clrPurple" "$clrWhite" && printf "\n\r"
diffDrillDownAdvanced "git diff --name-status origin/$actual $actual" "awk '{print \$2}'" "origin/$actual" "$actual"
executeCommand "git diff --name-status origin/$actual $actual"
read -p "Merge (y/n)? " -n 1 -r
Expand Down
6 changes: 5 additions & 1 deletion EasyKey.git/ezk-git-loca.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

oldmenudata=("${menudatamap[@]}")
old_calculatedMenuWidth=$calculatedMenuWidth
old_globalClmWidth=$globalClmWidth

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

source "$script_dir/../shellmenu.sh"
menudatamap=("${oldmenudata[@]}")
calculatedMenuWidth=$old_calculatedMenuWidth
globalClmWidth=$old_globalClmWidth

noterminate
15 changes: 15 additions & 0 deletions EasyKey.git/ezk-git-objects.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e
shopt -s nullglob extglob

cd "`git rev-parse --git-path objects`"

# packed objects
for p in pack/pack-*([0-9a-f]).idx ; do
git show-index < $p | cut -f 2 -d ' '
done

# loose objects
for o in [0-9a-f][0-9a-f]/*([0-9a-f]) ; do
echo ${o/\/}
done
10 changes: 5 additions & 5 deletions EasyKey.git/git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ globalClmWidth=35
git fetch --all --tags 2> /dev/null

menuInit "EasyKey.git"
submenuHead "Working with remotes:"
submenuHead "Working with remotes "
menuItemClm a "Gently push current" pushActual b "Set remote origin repo" setRemoteOrigin
menuItemClm e "Set upstream to current" setUpstream f "Administer remotes" adminRemotes
submenuHead "Working on local branches:"
submenuHead "Working on local branches "
menuItemClm r "Show branch history" showBranchHisto g "Show reflog" showRepoHisto
menuItemClm v "Checkout remote branch" coRemoteBranch n "Delete local/remote branch" deleteBranch
menuItemClm o "Merge source to target branch" mergeSourceToTarget p "Show all branches (incl. remote)" showAllBranches
menuItemClm k "New local/remote branch checkout" newLocalBranch c "Change last commit message" "git commit --amend"
submenuHead "Other usefull actions:"
submenuHead "Other usefull actions "
menuItemClm s "Working with diffs" workingDiffs w "Working with commits" atlassiansView
menuItemClm y "Setting up repositories" settingUp 5 "Git extras" gitExtras
submenuHead "Git admin actions:"
submenuHead "Git admin actions "
menuItemClm 1 "Show local git config" localGitConfig 2 "Show global git config" globalGitConfig
menuItemClm 3 "Administering aliases" adminAliases 4 "Show .gitignore" gitIgnore
menuItem x "Descrease repo size" repoSize
submenuHead "Shortcuts"
submenuHead "Shortcuts "
menuItemClm P "Change project" changeProject B "Change branch" changeBranch
menuItem F "Fetch all" fetchAll
startMenu "showStatus"
Expand Down
16 changes: 8 additions & 8 deletions EasyKey.kubectl/kubectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ source "$script_dir/../shellmenu.sh"
source "$script_dir/ezk-kubectl-functions.sh"

menuInit "EasyKey.kubectl"
submenuHead "Kubectl Config:" "Test:"
submenuHead "Kubectl Config "
menuItemClm a "Show config" "kubectl config view" b "Switch context" switchContext
menuItemClm c "Switch namespace" switchNamespace d "Add cluster" addCluster
menuItemClm e "Add users (token)" addUsers f "Add context" addContext
menuItemClm g "Edit config" "vim ~/.kube/config" h "Create namespace" createNamespace
submenuHead "Pods:"
submenuHead "Pods "
menuItemClm j "List pods (ns=current)" "kubectl get pods -o wide" k "List pods (all namespaces)" "kubectl get pods --all-namespaces -o wide"
menuItemClm l "Show pod manifest (desired/observed)" showPodManifest m "Describe pod" describePod
menuItemClm l "Show pod manifest" showPodManifest m "Describe pod" describePod
menuItemClm n "Get logs" getPodLogs o "Log on to pod" logOnPod
menuItemClm p "Log on to DB" logOnDb r "Apply pod manifest" applyPodManifest
menuItem s "Delete pod" deletePod
submenuHead "Deployments:"
submenuHead "Deployments "
menuItemClm v "List deployments (ns=current)" "kubectl get deployments -o wide" w "List deployments (all namespaces)" "kubectl get deployments --all-namespaces -o wide"
menuItemClm x "Show deployment manifest (desired/observed)" showDeploymentManifest y "Describe deployment" describeDeployment
menuItemClm x "Show deployment manifest" showDeploymentManifest y "Describe deployment" describeDeployment
menuItemClm z "List replicasets (ns=current)" "kubectl get rs -o wide" 1 "Describe replica set" describeReplicaset
menuItemClm 2 "Redeploy" redeploy 3 "Deployment history" deplHist
menuItemClm 4 "Undo deployment" rollbackDeployment 5 "Deployment status" deployState
menuItem E "Edit deployment" editDeployment
submenuHead "Services:"
submenuHead "Services "
menuItemClm 6 "List services (ns=current)" "kubectl get services -o wide" 7 "List services (all namespaces)" "kubectl get services --all-namespaces -o wide"
menuItemClm 8 "Show service manifest (desired/observed)" showServiceManifest 9 "Describe service" describeService
submenuHead "Other stuff:"
menuItemClm 8 "Show service manifest" showServiceManifest 9 "Describe service" describeService
submenuHead "Other stuff "
menuItemClm I "List images in contexts" listImagesInUse J "Ingress configuration" "kubectl get ing -o json | jq -r '.items[].spec.rules[].http.paths[]'"
menuItemClm K "Describe ingress" "kubectl describe ing" "L" "Edit config map" editConfigMap
menuItem T "Edit Ingress" "kubectl edit ingress"
Expand Down
6 changes: 3 additions & 3 deletions EasyKey.maven/maven.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source "$script_dir/ezk-maven-functions.sh"
globalClmWidth=20

menuInit "Super MAVEN Home"
submenuHead "Maven:"
submenuHead "Working with Maven POM "
menuItemClm a "Clean all eclipse" "mvnCleanEclipse" b "Maven analyze dependencies" "mvn dependency:analyze"
menuItemClm c "Clean install force updates" "mvn clean install -U -DskipTests" d "To maven repo" toRepo
menuItemClm e "Show effective settings" "mvn help:effective-settings" f "Local repo location" "mvn help:evaluate -Dexpression=settings.localRepository | grep -v '\[INFO\]'"
Expand All @@ -20,11 +20,11 @@ menuInit "Super MAVEN Home"
menuItemClm k "Download sources" downLoadSources l "Build with deps" "mvn clean compile assembly:single"
menuItemClm m "New project from archetype" newProject p "Effective pom" "mvn help:effective-pom"
menuItemClm t "Dependency tree" "mvn dependency:tree" u "Display dependency updates" "mvn versions:display-dependency-updates -DexcludeReactor=true"
submenuHead "Lifecycle:"
submenuHead "Lifecycle "
menuItemClm C "Clean compile" "mvn clean compile" T "Clean test" "mvn clean test"
menuItemClm I "Clean install" "mvn clean install -DskipTests" P "Clean package" "mvn clean package -DskipTests"
menuItem D "Clean deploy" "mvn clean deploy -DskipTests"
submenuHead "Spring-Boot:"
submenuHead "Spring-Boot "
menuItemClm o "Start Spring Boot App" startSpringBoot s "View application properties" showProperties
menuItem v "Usefull notes" useFull
startMenu "pwd"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ EasyKey.shellmenu is a simple script to generate menus for command execution in
- Use single or double column menu
- Call user-defined shell functions or immediately execute shell command
- Return to menu once command or function completed
- Log executed commands
- Log executed commands

👌 Increase your productivity and relax !

Expand Down
4 changes: 2 additions & 2 deletions maven_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ showGlobalSettingFile() {

clear
menuInit "Maven demo menu"
submenuHead "Life cycle commands:"
submenuHead "Life cycle commands "
menuItem c "Clean all" "mvn clean:clean"
menuItem x "Compile" "mvn clean compile"
menuItem t "Test" "mvn clean test"
menuItem i "Install" "mvn clean install"
submenuHead "Also usefull:"
submenuHead "Also usefull "
menuItem d "Analyze dependencies" "mvn dependency:analyze"
menuItem u "Clean compile force updates" "mvn clean compile -U -DskipTests"
menuItem e "Show effective settings" "mvn help:effective-settings"
Expand Down
Loading

0 comments on commit 173f2bd

Please sign in to comment.