From faa1d2c5cb09be9ff5c65f97a8312834a78c762a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 5 Feb 2022 23:01:31 -0500 Subject: [PATCH] py-compile: clean up usage info Include the full summary of options in the output. * lib/py-compile: Update usage output. * t/py-compile-usage.sh: Update test to match new output. --- lib/py-compile | 10 ++++++++-- t/py-compile-usage.sh | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/py-compile b/lib/py-compile index 0597c85b2..b5f317f15 100755 --- a/lib/py-compile +++ b/lib/py-compile @@ -1,7 +1,7 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2021-02-27.01; # UTC +scriptversion=2022-02-06.04; # UTC # Copyright (C) 2000-2022 Free Software Foundation, Inc. @@ -62,13 +62,19 @@ while test $# -ne 0; do ;; -h|--help) cat <<\EOF -Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..." +Usage: py-compile [options] FILES... Byte compile some python scripts FILES. Use --destdir to specify any leading directory path to the FILES that you don't want to include in the byte compiled file. Specify --basedir for any additional path information you do want to be shown in the byte compiled file. +Options: + --basedir DIR Prefix all FILES with DIR, and include in error messages. + --destdir DIR Prefix all FILES with DIR before compiling. + -v, --version Display version information. + -h, --help This help screen. + Example: py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py diff --git a/t/py-compile-usage.sh b/t/py-compile-usage.sh index 94c0c4c9d..f324ec9e6 100644 --- a/t/py-compile-usage.sh +++ b/t/py-compile-usage.sh @@ -29,8 +29,8 @@ cp "$am_scriptdir/py-compile" . \ cat stdout test -s stderr && { cat stderr >&2; exit 1; } grep '^Usage: py-compile .' stdout -$FGREP ' [--basedir DIR]' stdout -$FGREP ' [--destdir DIR]' stdout +$FGREP ' --basedir DIR ' stdout +$FGREP ' --destdir DIR ' stdout # --version -- 2.47.2