summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-09-19 07:01:34 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-11-20 22:53:31 -0500
commit343946c08902aecad2b52cdda5761e6246825e99 (patch)
tree4e664df178aeaf12e9c3fe19420b3c6a21c7b7a4 /src
parent6f6a58874ed66111ad0563e77fc01aef413f98ca (diff)
sq - docs
Diffstat (limited to 'src')
-rwxr-xr-xsrc/chroot-tools/librechroot28
-rw-r--r--src/lib/messages.sh17
2 files changed, 25 insertions, 20 deletions
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot
index 9367ef8..2462f4b 100755
--- a/src/chroot-tools/librechroot
+++ b/src/chroot-tools/librechroot
@@ -216,6 +216,8 @@ readonly DEF_PACMANCONF_DIR=/usr/share/pacman/defaults
usage() {
eval "$(calculate_directories)"
+ local mount_msg="$(_ 'PATH[:INSIDE_PATH[:OPTIONS]]')"
+
print "Usage: %s [OPTIONS] COMMAND [ARGS...]" "${0##*/}"
echo
print 'Interacts with a libre "archroot" (similarly to `arch-chroot`).'
@@ -287,20 +289,18 @@ usage() {
prose 'Creating/deleting/synchronizing a copy, can be relatively slow;
but can be very fast, if $CHROOTDIR is on a btrfs partition.'
echo
- flag 'Options:' \
- "-n <$(_ NAME)>" 'Name of the chroot to use' \
- "-l <$(_ COPY)>" 'Name of, or absolute path to, the copy to use' \
- "-C <$(_ FILE)>" 'Copy this file to chroot as: `/etc/pacman.conf`
- This option is mutually exclusive with -A.' \
- "-M <$(_ FILE)>" 'Copy this file to chroot as: `/etc/makepkg.conf`
- This option is mutually exclusive with -A.' \
- "-A <$(_ CARCH)>" 'Specify the architecture of a new `root` seed.
- This option is mutually exclusive with -C and -M.' \
- "-N" 'Disable networking in the chroot' \
- "-w <$(_ 'PATH[:INSIDE_PATH[:OPTIONS]]')>" 'Bind mount a file or
- directory, read/write' \
- "-r <$(_ 'PATH[:INSIDE_PATH[:OPTIONS]]')>" 'Bind mount a file or
- directory, read-only'
+ flag 'Options:' \
+ "-n <$(_ NAME)>" 'Name of the chroot to use' \
+ "-l <$(_ COPY)>" 'Name of, or absolute path to, the copy to use' \
+ "-C <$(_ FILE)>" 'Copy this file to chroot as: `/etc/pacman.conf`
+ This option is mutually exclusive with -A.' \
+ "-M <$(_ FILE)>" 'Copy this file to chroot as: `/etc/makepkg.conf`
+ This option is mutually exclusive with -A.' \
+ "-A <$(_ CARCH)>" 'Specify the architecture of a new `root` seed.
+ This option is mutually exclusive with -C and -M.' \
+ "-N" 'Disable networking in the chroot' \
+ "-w <${mount_msg}>" 'Bind mount a file or directory, read/write' \
+ "-r <${mount_msg}>" 'Bind mount a file or directory, read-only'
echo
flag 'Commands (create/copy/delete):' \
'make' 'Create a `root` seed and working copy' \
diff --git a/src/lib/messages.sh b/src/lib/messages.sh
index a43533a..b96c637 100644
--- a/src/lib/messages.sh
+++ b/src/lib/messages.sh
@@ -106,15 +106,20 @@ bullet() {
printf -- "$mesg" "$@" | fmt -u -w 71 | sed -e '1s/^/ - /' -e '2,$s/^/ /'
}
-# Usage: flag [FLAG DESCRIPTION|HEADING:]...
+# Usage: flag |HEADING:] [FLAG DESCRIPTION [FLAG DESCRIPTION]...]
#
-# Print a flag and description formatted for --help text.
+# Print formatted for --help text, a heading, to preceed a (possibly empty)
+# list of flags and their description, or a list of flags and descriptions,
+# with an optional heading.
#
-# ex: flag '-C <FILE>' 'Use this file instead of pacman.conf'
+# ex: flag 'Options:' '-C <FILE>' 'Use this file instead of pacman.conf'
+# ex: flag 'Options:'
+# flag '-C <FILE>' 'Use this file instead of pacman.conf' \
+# '-n <NAME>' 'Name of the chroot to use'
#
-# The descriptions and headings are fed through gettext, the flags ar
-# not, so if part of a flag needs to be translated, you must handle
-# that explicitly, using $(_ <MSGID_STRING>):
+# The headings and descriptions are fed through gettext; but the flags are not.
+# If part of a flag needs to be translated, you must handle that explicitly,
+# using the translation helper directly, of the form $(_ <MSGID_STRING>).
#
# ex: flag "-C <$(_ FILE)>" 'Use this file instead of pacman.conf'
#