From 37a3cb0fdb8fe871bb24cdb5e328fa00e1155b3f Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sat, 12 May 2018 12:45:55 -0400 Subject: Adds -l flag to change logfile -l flag changes logfile (file with output of internal commands from /tmp/PLUGVIM-date.log to .plug/date.log --- src/plug.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plug.sh b/src/plug.sh index ab022bc..1a95764 100755 --- a/src/plug.sh +++ b/src/plug.sh @@ -33,7 +33,7 @@ fi PLUG_PATH=".vim/pack/$USER/start/" VIM_PATH="vim" JOBS=4 -LOG_FILE=~/.plug/$(date -Is).log +LOG_FILE=/tmp/PLUGVIM-$(date -Is).log GIT_DIR="$HOME/dotfiles" PROGRAM="plug" touch $LOG_FILE @@ -84,7 +84,7 @@ cmd_usage () { } cmd_install() { - while getopts ":ocg:d:" opt; + while getopts ":ocg:d:l" opt; do case $opt in o) @@ -99,6 +99,9 @@ cmd_install() { d) VIM_PATH=$OPTARG ;; + l) + LOG_FILE=~/.plug/$(date -Is).log + ;; \?) echo "Invalid option: -$OPTARG" >&2 return @@ -135,7 +138,7 @@ cmd_install() { } cmd_update() { - while getopts ":jc" opt; + while getopts ":jcl" opt; do case $opt in c) @@ -144,6 +147,9 @@ cmd_update() { j) JOBS=$OPTARG ;; + l) + LOG_FILE=~/.plug/$(date -Is).log + ;; \?) echo "Invalid option: -$OPTARG" >&2 return @@ -173,7 +179,7 @@ cmd_update() { } cmd_remove() { - while getopts ":ocd:g:" opt; + while getopts ":ocd:g:l" opt; do case $opt in o) @@ -188,6 +194,9 @@ cmd_remove() { d) VIM_PATH=$OPTARG ;; + l) + LOG_FILE=~/.plug/$(date -Is).log + ;; \?) echo "Invalid option: -$OPTARG" >&2 return @@ -224,12 +233,15 @@ cmd_remove() { } cmd_list() { - while getopts ":ocg:" opt; + while getopts ":ocg:l" opt; do case $opt in g) GIT_DIR=$OPTARG ;; + l) + LOG_FILE=~/.plug/$(date -Is).log + ;; \?) echo "Invalid option: -$OPTARG" >&2 return -- cgit v1.1