/usr/bin/extract_usage_from_stx is in stx2any 1.56-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/bin/sh
# This file is copyright (c) 2004,2005,2006 by Panu Kalliokoski
# and released under the license in ../LICENSE
BASE=/usr/share/stx2any
usage() {
cat $BASE/messages/extract_usage_from_stx.usage 1>&2
exit $1
}
case "$1" in
--help|-\?) usage 0 ;;
--version|-V)
cat $BASE/messages/version.msg
exit 0
;;
esac
sed -n \
-e '/^! *SYNOPSIS/,/^!/{' \
-e '/^$/,/./{' \
-e 's#^[^ !]#Usage: &#' \
-e '}' \
-e '/^!/!p' \
-e '}' \
-e '/^! *OPTIONS/,/^!/{' \
-e 's#^! *OPTIONS.*#Options:#p' \
-e '/^!/d' \
-e '/^[^ ].*::$/,/\./{' \
-e 's#\. .*#.#' \
-e 'p' \
-e '}' \
-e '}' $@ || usage 1
|