File tree 1 file changed +16
-4
lines changed
1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 4
4
# Distributed under the MIT license.
5
5
# http://www.opensource.org/licenses/mit-license.php
6
6
7
- if (( $# != 1 )) ; then
8
- echo " usage: $0 file.clj"
7
+ abort_with_help () {
8
+ echo " usage: $( basename " $0 " ) [-p PREFIX] file.clj"
9
9
exit 1
10
- fi
10
+ }
11
+
12
+ PREFIX=' report'
13
+
14
+ while getopts :p: opt; do
15
+ case " $opt " in
16
+ p) PREFIX=" $OPTARG " ;;
17
+ h) abort_with_help;;
18
+ esac
19
+ done
20
+ shift $(( OPTIND- 1 ))
21
+
22
+ (( $# == 1 )) || abort_with_help
11
23
12
24
VIMRC="
13
25
set runtimepath^=$( dirname " $0 " ) /../..
@@ -17,6 +29,6 @@ syntime on
17
29
"
18
30
19
31
exec vim -N -u <( echo " $VIMRC " ) \
20
- -c ' execute " redir > " . strftime("report-%Y-%m-%d-%H-%M-%S .log") ' \
32
+ -c " execute ' redir > ' . strftime(' ${PREFIX} - $( date +%s.%N ) .log') " \
21
33
-c ' call feedkeys(repeat("j", line("$")-1) . ":silent syntime report | quit\<CR>")' \
22
34
" $1 "
You can’t perform that action at this time.
0 commit comments