This repository was archived by the owner on Apr 25, 2024. It is now read-only.
File tree 3 files changed +16
-4
lines changed
3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ MANPREFIX ?= $(PREFIX)/share/man
7
7
8
8
MANPAGE = auto-inhibit.1
9
9
10
- all : $(MANPAGE )
10
+ all : auto-inhibit $(MANPAGE )
11
+
12
+ auto-inhibit : auto-inhibit.in
13
+ sed -e " s/VERSION=/VERSION=$( VERSION) /" auto-inhibit.in > auto-inhibit
14
+ chmod +x auto-inhibit
11
15
12
16
$(MANPAGE ) : man/$(MANPAGE ) .pod
13
17
pod2man -n=auto-inhibit -c=auto-inhibit -r=$(VERSION ) $< $(MANPAGE )
@@ -26,9 +30,9 @@ uninstall:
26
30
rm -f $(DESTDIR )$(MANPREFIX ) /man1/auto-inhibit.1
27
31
28
32
clean :
29
- rm -f $(MANPAGE )
33
+ rm -f auto-inhibit $(MANPAGE )
30
34
31
- test :
35
+ test : auto-inhibit
32
36
$(MAKE ) -C test
33
37
34
38
.PHONY : all install uninstall clean test
Original file line number Diff line number Diff line change 4
4
5
5
set -eu
6
6
7
+ readonly VERSION=
8
+
7
9
readonly CONFIG=" ${AUTO_INHIBIT_CONF:-/ etc/ auto-inhibit.conf} "
8
10
readonly INHIBITOR=" ${AUTO_INHIBITOR:- $(command -v auto-inhibit)} "
9
11
@@ -64,6 +66,7 @@ usage() {
64
66
options:
65
67
-h Show help message
66
68
-d DIR Operate on DIR
69
+ -v Show version
67
70
68
71
commands:
69
72
list List symlinks
@@ -85,10 +88,11 @@ status() {
85
88
exit $?
86
89
}
87
90
88
- while getopts ' :hd:' opt; do
91
+ while getopts ' :hd:v ' opt; do
89
92
case " $opt " in
90
93
h) usage; exit ;;
91
94
d) symdir=" $OPTARG " ;;
95
+ v) echo " $VERSION " ; exit ;;
92
96
* ) usage >&2 ; exit 2
93
97
esac
94
98
done
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ Show help message.
23
23
24
24
Operate on I<DIRECTORY>.
25
25
26
+ =item B<-v>
27
+
28
+ Show version.
29
+
26
30
=back
27
31
28
32
=head1 COMMANDS
You can’t perform that action at this time.
0 commit comments