#!/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.
;;
-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
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