mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -55,7 +55,7 @@ snippet go
|
||||
done
|
||||
# Set SCRIPT_DIR variable to directory script is located.
|
||||
snippet sdir
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
SCRIPT_DIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
||||
# getopt
|
||||
snippet getopt
|
||||
__ScriptVersion="${1:version}"
|
||||
@ -66,7 +66,7 @@ snippet getopt
|
||||
#===============================================================================
|
||||
function usage ()
|
||||
{
|
||||
echo "Usage : $${0:0} [options] [--]
|
||||
echo "Usage : \$${0:0} [options] [--]
|
||||
|
||||
Options:
|
||||
-h|help Display this message
|
||||
@ -80,18 +80,18 @@ snippet getopt
|
||||
|
||||
while getopts ":hv" opt
|
||||
do
|
||||
case $opt in
|
||||
case \$opt in
|
||||
|
||||
h|help ) usage; exit 0 ;;
|
||||
|
||||
v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;;
|
||||
v|version ) echo "\$${0:0} -- Version \$__ScriptVersion"; exit 0 ;;
|
||||
|
||||
* ) echo -e "\n Option does not exist : $OPTARG\n"
|
||||
* ) echo -e "\\n Option does not exist : \$OPTARG\\n"
|
||||
usage; exit 1 ;;
|
||||
|
||||
esac # --- end of case ---
|
||||
done
|
||||
shift $(($OPTIND-1))
|
||||
shift \$(($OPTIND-1))
|
||||
snippet root
|
||||
if [ \$(id -u) -ne 0 ]; then exec sudo \$0; fi
|
||||
|
||||
|
Reference in New Issue
Block a user