source: projects/vine-manual-skel/trunk/vine-manual-init.in @ 4589

Revision 4589, 1.2 KB checked in by yasumichi, 13 years ago (diff)

--help, --version オプションのみ実装

Line 
1#!/bin/sh
2
3# Directories
4prefix=@prefix@
5datarootdir=@datarootdir@
6datadir=@datadir@
7templatedir=@datadir@/vine-manual-skel/template
8
9# My name
10MYNAME=`basename $0`
11
12# print usage
13print_usage()
14{
15cat << EOM
16${MYNAME}       Initialize package of manual for Vine Linux.
17
18Usage: ${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
23EOM
24}
25
26# print version
27print_version()
28{
29cat << EOM
30${MYNAME} @VERSION@
31
32Copyright (C) 2011 Project Vine.
33This is free software; see the source for copying conditions.  There is NO
34warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
35
36Written by Yasumichi Akahoshi <yasumichi@vinelinux.org>
37EOM
38}
39
40#
41# parse arguments.
42#
43if [ -z "$*" ]; then
44        print_usage
45        exit 1
46fi
47
48while [ ! -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
74done
75
76
Note: See TracBrowser for help on using the repository browser.