Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/pkgctl.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkgctl.in')
-rw-r--r--src/pkgctl.in56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/pkgctl.in b/src/pkgctl.in
new file mode 100644
index 0000000..9b7d89c
--- /dev/null
+++ b/src/pkgctl.in
@@ -0,0 +1,56 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+m4_include(lib/common.sh)
+
+set -e
+
+
+usage() {
+ local -r COMMAND=${BASH_SOURCE[0]##*/}
+ cat <<- _EOF_
+ Usage: ${COMMAND} [COMMAND] [OPTIONS]
+
+ Unified command-line frontend for devtools.
+
+ COMMANDS
+ diff Compare package files using different modes
+ repo Manage Git packaging repositories and their configuration
+
+ OPTIONS
+ -h, --help Show this help text
+_EOF_
+}
+
+if (( $# < 1 )); then
+ usage
+ exit 1
+fi
+
+export _DEVTOOLS_COMMAND='pkgctl'
+
+# command checking
+while (( $# )); do
+ case $1 in
+ -h|--help)
+ usage
+ exit 0
+ ;;
+ repo)
+ _DEVTOOLS_COMMAND+=" $1"
+ shift
+ pkgrepo "$@"
+ exit 0
+ ;;
+ diff)
+ _DEVTOOLS_COMMAND+=" $1"
+ shift
+ diffpkg "$@"
+ exit 0
+ ;;
+ *)
+ die "invalid command: %s" "$1"
+ ;;
+ esac
+done