Last active
October 12, 2021 23:45
-
-
Save sempervent/4d94593e0d56f8fc1b43f92b9983d61f to your computer and use it in GitHub Desktop.
Revisions
-
sempervent revised this gist
Oct 11, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ die() { # {{{2 warn() { # {{{2 echo -e "\\e[33mWARNING:\\e[39m $1" } # 2}}} info() { # {{{2 echo -e "\\e[32mINFO:\\e[39m $1" } # 2}}} show_help() { # {{{2 -
sempervent revised this gist
Oct 11, 2021 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,10 @@ die() { # {{{2 } # 2}}} warn() { # {{{2 echo -e "\\e[33mWARNING:\\e[39m $1" } # 2}}} inf() { # {{{2 echo -e "\\e[32mINFO:\\e[39m $1" } # 2}}} show_help() { # {{{2 grep '^#/' "${BASH_SOURCE[0]}" | cut -c4- || \ die "Failed to display usage information" -
sempervent revised this gist
Feb 6, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ #!/usr/bin/env bash # ex: set fdm=marker # usage {{{1 #/ Usage: #/ -h|-?|--help) -
sempervent revised this gist
Feb 6, 2020 . 1 changed file with 36 additions and 27 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,46 +1,55 @@ #!/usr/bin/env bash # usage {{{1 #/ Usage: #/ -h|-?|--help) #/ show this help and exit #/ # 1}}} # environment {{{1 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" PROJECT=${PROJECT:-"Some Project Name in $DIR"} # 1}}} # functions {{{1 banner() { # {{{2 # make a static banner with embeded color codes # BANNER=$(cat <<EOF\n EOF; # for a simple banner use # BANNER="The \n$PROJECT\n\t script" # or have a little funn # BANNER=$(figlet "$PROJECT" | cowsay) # or do some coloring BANNER="\\e[32$PROJECT\\e[39m" echo -e "$BANNER" } # 2}}} die() { # {{{2 echo -e "\\e[31mFAILURE:\\e[39m $1" exit 1 } # 2}}} warn() { # {{{2 echo -e "\\e[33mWARNING:\\e[39m $1" } # 2}}} show_help() { # {{{2 grep '^#/' "${BASH_SOURCE[0]}" | cut -c4- || \ die "Failed to display usage information" } # 2}}} # 1}}} # arguments {{{1 while :; do case $1 in # check arguments {{{2 -h|-\?|--help) # help {{{3 banner show_help exit ;; # 3}}} -?*) # unknown argument {{{3 warn "Unknown option (ignored): $1" shift ;; # 3}}} *) # default {{{3 break # 3}}} esac # 2}}} done # 1}}} # logic {{{1 banner # 1}}} -
sempervent revised this gist
Oct 3, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,7 @@ #/ # 1}}} ------------------------------------------------------------------------ # environment {{{1 ------------------------------------------------------------ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # 1}}} ------------------------------------------------------------------------ # functions {{{1 -------------------------------------------------------------- banner() { # {{{2 ------------------------------------------------------------- -
sempervent revised this gist
Sep 23, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,4 +41,5 @@ while :; do done # 1}}} ------------------------------------------------------------------------ # logic {{{1 ------------------------------------------------------------------ banner # 1}}} ------------------------------------------------------------------------ -
sempervent revised this gist
Sep 23, 2019 . 1 changed file with 20 additions and 20 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,36 +9,36 @@ # 1}}} ------------------------------------------------------------------------ # functions {{{1 -------------------------------------------------------------- banner() { # {{{2 ------------------------------------------------------------- echo -e "\\e[31m Some Project Banner\\e[39m" } # 2}}} ---------------------------------------------------------------------- die() { # {{{2 ---------------------------------------------------------------- echo -e "\\e[31mFAILURE:\\e[39m $1" exit 1 } # 2}}} ---------------------------------------------------------------------- warn() { # {{{2 --------------------------------------------------------------- echo -e "\\e[33mWARNING:\\e[39m $1" } # 2}}} ---------------------------------------------------------------------- show_help() { # {{{2 ---------------------------------------------------------- grep '^#/' "${BASH_SOURCE[0]}" | cut -c4- || \ die "Failed to display usage information" } # 2}}} ---------------------------------------------------------------------- # 1}}} ------------------------------------------------------------------------ # arguments {{{1 -------------------------------------------------------------- while :; do case $1 in # check arguments {{{2 ------------------------------------------- -h|-\?|--help) # help {{{3 ------------------------------------------------ banner show_help exit ;; # 3}}} --------------------------------------------------------------- -?*) # unknown argument {{{3 ---------------------------------------------- warn "Unknown option (ignored): $1" shift ;; # 3}}} --------------------------------------------------------------- *) # default {{{3 --------------------------------------------------------- break # 3}}} ------------------------------------------------------------ esac # 2}}} ----------------------------------------------------------------- done # 1}}} ------------------------------------------------------------------------ # logic {{{1 ------------------------------------------------------------------ # 1}}} ------------------------------------------------------------------------ -
sempervent created this gist
Sep 23, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ #!/usr/bin/env bash # usage {{{1 ------------------------------------------------------------------ #/ Usage: #/ -h|-?|--help) #/ show this help and exit #/ # 1}}} ------------------------------------------------------------------------ # environment {{{1 ------------------------------------------------------------ # 1}}} ------------------------------------------------------------------------ # functions {{{1 -------------------------------------------------------------- banner() { # {{{2 ------------------------------------------------------------- echo -e "\\e[31m Some Project Banner\\e[39m" } # 2}}} ---------------------------------------------------------------------- die() { # {{{2 ---------------------------------------------------------------- echo -e "\\e[31mFAILURE:\\e[39m $1" exit 1 } # 2}}} ---------------------------------------------------------------------- warn() { # {{{2 --------------------------------------------------------------- echo -e "\\e[33mWARNING:\\e[39m $1" } # 2}}} ---------------------------------------------------------------------- show_help() { # {{{2 ---------------------------------------------------------- grep '^#/' "${BASH_SOURCE[0]}" | cut -c4- || \ die "Failed to display usage information" } # 2}}} ---------------------------------------------------------------------- # 1}}} ------------------------------------------------------------------------ # arguments {{{1 -------------------------------------------------------------- while :; do case $1 in # check arguments {{{2 ------------------------------------------- -h|-\?|--help) # help {{{3 ------------------------------------------------ banner show_help exit ;; # 3}}} --------------------------------------------------------------- -?*) # unknown argument {{{3 ---------------------------------------------- warn "Unknown option (ignored): $1" shift ;; # 3}}} --------------------------------------------------------------- *) # default {{{3 --------------------------------------------------------- break # 3}}} ------------------------------------------------------------ esac # 2}}} ----------------------------------------------------------------- done # 1}}} ------------------------------------------------------------------------ # logic {{{1 ------------------------------------------------------------------ # 1}}} ------------------------------------------------------------------------