#!/bin/bash choice="$1" query_string="$2" arg="$(echo "$choice" | cut -c 5-)" arg="${arg/#\~/$HOME}" case $choice in git*) tree -L 1 $arg exit 0 ;; win*) echo $choice exit 0 ;; app*) echo $choice exit 0 ;; emj*) echo $choice exit 0 ;; fil*) echo $choice exit 0 ;; mvr*) groupId="$(echo "$arg" | sed 's/\(.*\):.*/\1/')" artifactId="$(echo "$arg" | sed 's/.*:\(.*\) .*/\1/')" latestVersion="$(echo "$arg" | sed 's/.* \(.*\)/\1/')" echo "" echo " $groupId" echo " $artifactId" echo " $latestVersion" echo "" exit 0 ;; inf*) date echo free -h echo df -h | grep '/dev\|Filesystem' ;; *) qarg="$(echo "$query_string" | cut -c 5-)" qarg="${qarg/#\~/$HOME}" case $query_string in mvn*) curl -s "https://search.maven.org/solrsearch/select?q=$qarg&rows=5&wt=json" | jq '[.response.docs[] | { g, a, latestVersion, timestamp } ]' 2>/dev/null ;; npm*) NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion npm search $qarg | tail -n +2 ;; esac ;; esac