diff options
-rw-r--r-- | README.rst | 1 | ||||
-rw-r--r-- | man/plug.1 | 14 | ||||
-rwxr-xr-x | src/plug.sh | 22 |
3 files changed, 28 insertions, 9 deletions
@@ -44,6 +44,7 @@ Options - **-d "directory containing .vim"** default: GIT_REPO/vim/ - **-o** place plugin in opt folder instead of start. - **-c** commit changes +- **-l** log internal command output in ~/.plug/date.log instead of /tmp/PLUGVIM-date.log Examples ~~~~~~~~ @@ -19,21 +19,21 @@ support and git submodules. .SH COMMANDS .TP -\fBinstall\fP [\fI-oc\fP] [-g \fIGIT-REPO\fP] [-d \fI.vim-LOCATION\fP] plugin-name +\fBinstall\fP [\fI-ocl\fP] [-g \fIGIT-REPO\fP] [-d \fI.vim-LOCATION\fP] plugin-name Install plugin at remote git repo as submodule in GIT-REPO. .TP -\fBupdate\fP [\fI-c\fP] [-g \fIGIT-REPO\fP] [-j \fITHREAD-COUNT\fP] "remote git repo" +\fBupdate\fP [\fI-cl\fP] [-g \fIGIT-REPO\fP] [-j \fITHREAD-COUNT\fP] "remote git repo" Update all git modules. .TP -\fBremove\fP [\fI-oc\fP] [-g \fIGIT-REPO\fP] [-d \fI.vim-LOCATION\fP] plugin-name +\fBremove\fP [\fI-ocl\fP] [-g \fIGIT-REPO\fP] [-d \fI.vim-LOCATION\fP] plugin-name Remove plugin. .TP -\fBlist\fP [-g \fIGIT-REPO\fP] +\fBlist\fP [-l] [-g \fIGIT-REPO\fP] List installed plugins. .TP @@ -80,6 +80,12 @@ Default: GIT_REPO/vim/ Number of jobs for "git submodule update" to use. .RE +.PP +\-l +.RS 4 +Changes logfile (where internal command output is redirected) from the +default of /tmp/PLUGVIM-date.log to ~/.plug/date.log + .SH AUTHOR .B plug was written by 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 |