From a8be7423efb287edd5ef80002a75a853fc0c9c1d Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Mon, 12 Sep 2022 01:34:08 +0200 Subject: pkgctl: add a unified command-line frontend for devtools This is the first step of a simple and highly structured unified interface to devtools commands in a single wrapper. The split is based on groups like `repo`, `build` and `diff` Signed-off-by: Levente Polyak --- src/diffpkg.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/diffpkg.in') diff --git a/src/diffpkg.in b/src/diffpkg.in index 6d07419..4856e44 100644 --- a/src/diffpkg.in +++ b/src/diffpkg.in @@ -5,8 +5,9 @@ m4_include(lib/common.sh) usage() { - cat <<- _EOF_ - Usage: ${BASH_SOURCE[0]##*/} [OPTIONS] [MODES] [FILE|PKGNAME...] + local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} + cat <<- _EOF_ + Usage: ${COMMAND} [OPTIONS] [MODES] [FILE|PKGNAME...] Searches for a locally built package corresponding to the PKGBUILD, and downloads the last version of that package from the Pacman repositories. @@ -17,8 +18,8 @@ usage() { When given two packages, diff both packages against each other. In either case, a package name will be converted to a filename from the - cache, and diffpkg will proceed as though this filename was initially - specified. + cache, and '${COMMAND}' will proceed as though this filename was + initially specified. OPTIONS -M, --makepkg-config Set an alternate makepkg configuration file @@ -300,7 +301,7 @@ shopt -u extglob if (( $# < 2 )); then if [[ ! -f PKGBUILD ]]; then - die "This must be run in the directory of a built package.\nTry '$(basename "$0") --help' for more information." + die "This must be run in the directory of a built package.\nTry '${COMMAND} --help' for more information." fi # shellcheck source=contrib/makepkg/PKGBUILD.proto -- cgit v1.2.3-70-g09d2