aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2018-05-12 12:45:55 -0400
committerTucker Evans <tuckerevans24@gmail.com>2018-05-12 12:45:55 -0400
commit37a3cb0fdb8fe871bb24cdb5e328fa00e1155b3f (patch)
tree4956739135b25eb887b3d7bcb1273d8c9872a126
parent461b0e8969b89ea37cc78867f333494b1d0e5de2 (diff)
Adds -l flag to change logfileHEADmaster
-l flag changes logfile (file with output of internal commands from /tmp/PLUGVIM-date.log to .plug/date.log
-rw-r--r--README.rst1
-rw-r--r--man/plug.114
-rwxr-xr-xsrc/plug.sh22
3 files changed, 28 insertions, 9 deletions
diff --git a/README.rst b/README.rst
index 51def02..75d6a6a 100644
--- a/README.rst
+++ b/README.rst
@@ -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
~~~~~~~~
diff --git a/man/plug.1 b/man/plug.1
index 14cf7f2..5f285f7 100644
--- a/man/plug.1
+++ b/man/plug.1
@@ -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