OSDN Git Service

[IMPROVED] Adapt to the specification change of pkg-create(8) that the default extens...
[portsreinstall/current.git] / lib / libusage.sh
1 #!/bin/sh -e
2 # ==============================================================================
3 # portsreinstall library script
4 # - Help messages -
5 # Copyright (C) 2018-2021 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
6 # This software is distributed under the 2-Clause BSD License.
7 # ==============================================================================
8
9 # ============= Output a short help =============
10 usage_short ()
11 {
12         usage_short_content | fold -s -w `misc_get_console_column_size`
13 }
14
15 # ============= Content of the short help =============
16 usage_short_content () { :; }
17
18 # ============= Output a long help =============
19 usage_long ()
20 {
21         local manpage_path
22         manpage_path=${MYPREFIX}/man/man8/${APPNAME}.8
23         if [ -e "$manpage_path.gz" ]
24         then
25                 zcat "$manpage_path.gz"
26         elif [ -e "$manpage_path" ]
27         then
28                 cat "$manpage_path"
29         fi | nroff -man
30 }