Revision 4589,
1.2 KB
checked in by yasumichi, 13 years ago
(diff) |
--help, --version オプションのみ実装
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | # Directories |
---|
4 | prefix=@prefix@ |
---|
5 | datarootdir=@datarootdir@ |
---|
6 | datadir=@datadir@ |
---|
7 | templatedir=@datadir@/vine-manual-skel/template |
---|
8 | |
---|
9 | # My name |
---|
10 | MYNAME=`basename $0` |
---|
11 | |
---|
12 | # print usage |
---|
13 | print_usage() |
---|
14 | { |
---|
15 | cat << EOM |
---|
16 | ${MYNAME} Initialize package of manual for Vine Linux. |
---|
17 | |
---|
18 | Usage: ${MYNAME} [OPTION]... PACAGE-NAME |
---|
19 | |
---|
20 | -d, --docdir change install directory name instead of package name |
---|
21 | --help display help and exit |
---|
22 | --version output version information and exit |
---|
23 | EOM |
---|
24 | } |
---|
25 | |
---|
26 | # print version |
---|
27 | print_version() |
---|
28 | { |
---|
29 | cat << EOM |
---|
30 | ${MYNAME} @VERSION@ |
---|
31 | |
---|
32 | Copyright (C) 2011 Project Vine. |
---|
33 | This is free software; see the source for copying conditions. There is NO |
---|
34 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
35 | |
---|
36 | Written by Yasumichi Akahoshi <yasumichi@vinelinux.org> |
---|
37 | EOM |
---|
38 | } |
---|
39 | |
---|
40 | # |
---|
41 | # parse arguments. |
---|
42 | # |
---|
43 | if [ -z "$*" ]; then |
---|
44 | print_usage |
---|
45 | exit 1 |
---|
46 | fi |
---|
47 | |
---|
48 | while [ ! -z "$*" ]; do |
---|
49 | case $1 in |
---|
50 | -d|--docdir) |
---|
51 | DOCDIR=$2 |
---|
52 | shift |
---|
53 | ;; |
---|
54 | --help) |
---|
55 | print_usage |
---|
56 | exit |
---|
57 | ;; |
---|
58 | --version) |
---|
59 | print_version |
---|
60 | exit |
---|
61 | ;; |
---|
62 | *) |
---|
63 | if [ -z "${TARGET}" ]; then |
---|
64 | TARGET=$1 |
---|
65 | else |
---|
66 | echo "Too many targets." >&2 |
---|
67 | echo >&2 |
---|
68 | print_usage |
---|
69 | exit 1 |
---|
70 | fi |
---|
71 | ;; |
---|
72 | esac |
---|
73 | shift |
---|
74 | done |
---|
75 | |
---|
76 | |
---|
Note: See
TracBrowser
for help on using the repository browser.