Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Niklas Schlimm
Niklas Schlimm

Posted on

Automate your command line with EasyKey.shellmenu

As a developer, I work with many different tools on the command line. That's why I got into the habit of recording everything in a simple shell menu. That's how I came up withEasyKey.shellmenu. This allows me to easily create shell menus for my tools. I use it for kubectl, Maven and Git. Here is an example:

source "/path/to/shellmenu.sh"
menuInit "Maven demo menu"
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:"
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"
menuItem r "Show local repo location" "mvn help:evaluate -Dexpression=settings.localRepository | grep -v '\[INFO\]'"
menuItem l "Show global settings file location" showGlobalSettingFile
startMenu

The snippet creates a simple Maven menu like this:

Image description

In the repository on Github forEasyKey.shellmenu there are two more complex examples of menus for Git and kubectl. Check it out an if you like it please leave me a star for sharing it.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Plain old developer.
  • Joined

More fromNiklas Schlimm

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp