summaryrefslogtreecommitdiffhomepage
path: root/subr
diff options
context:
space:
mode:
Diffstat (limited to 'subr')
-rw-r--r--subr/build_init.subr14
-rw-r--r--subr/pkgtool_init.subr7
2 files changed, 18 insertions, 3 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr
index 8933fff1..3d8a42c9 100644
--- a/subr/build_init.subr
+++ b/subr/build_init.subr
@@ -142,7 +142,12 @@ buildp_init_getopts() {
--dump-on-abort)
ARG_DUMP_ON_ABORT=1; _shiftfl=1; ;;
--debug-minipx) ARG_DEBUG_MINIPIX=1; _shiftfl=1; ;;
- --help) cat etc/build.usage; exit 0; ;;
+ --help)
+ if [ -t 1 ]; then
+ cat etc/build.usage;
+ else
+ sed 's/\[[0-9]\+m//g' etc/build.usage;
+ fi; exit 0; ;;
--reset-state) ARG_RESET_PKG=1; _shiftfl=1; ;;
-v*) _opt="${1#-}"; while [ -n "${_opt}" ]; do
: $((_verbose+=1)); _opt="${_opt#?}";
@@ -175,7 +180,12 @@ buildp_init_getopts() {
C) ARG_CLEAN_BUILDS="${OPTARG}"; ;;
D) ARG_DIST="${OPTARG}"; ;;
F) ARG_FETCH_FORCE="${OPTARG}"; ;;
- h) cat etc/build.usage.short; exit 0; ;;
+ h)
+ if [ -t 1 ]; then
+ cat etc/build.usage.short;
+ else
+ sed 's/\[[0-9]\+m//g' etc/build.usage.short;
+ fi; exit 0; ;;
p) ARG_PARALLEL="${OPTARG}"; ;;
P) ARG_PARALLEL="auto";
if [ -n "${2:-}" ]\
diff --git a/subr/pkgtool_init.subr b/subr/pkgtool_init.subr
index b7c04c70..1bbcbf75 100644
--- a/subr/pkgtool_init.subr
+++ b/subr/pkgtool_init.subr
@@ -87,7 +87,12 @@ pkgtoolp_init_getopts_help() {
local _opt="";
while getopts a:b:hirst _opt 2>/dev/null; do
case "${_opt}" in
- h) cat etc/pkgtool.usage; exit 0; ;;
+ h)
+ if [ -t 1 ]; then
+ cat etc/pkgtool.usage;
+ else
+ sed 's/\[[0-9]\+m//g' etc/pkgtool.usage;
+ fi; exit 0; ;;
esac; done; shift $((${OPTIND}-1));
};