From 7eac078e1049493d708097af69f6894d609ec6a8 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Wed, 11 May 2022 13:30:22 +0200 Subject: Implement pkg subcommand --- lib/main.bash | 2 ++ lib/subcommands/pkg.bash | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 lib/subcommands/pkg.bash (limited to 'lib') diff --git a/lib/main.bash b/lib/main.bash index 385773f..cf3e069 100644 --- a/lib/main.bash +++ b/lib/main.bash @@ -78,6 +78,7 @@ Usage: $BASHTARD_NAME add $BASHTARD_NAME del $BASHTARD_NAME init [repository] + $BASHTARD_NAME pkg $BASHTARD_NAME ssh $BASHTARD_NAME sync [playbook] $BASHTARD_NAME sysinfo @@ -89,6 +90,7 @@ Perform maintenance on your infra. Commands: add Add a configuration playbook to this machine. init Initialize the $BASHTARD_NAME configuration system. + pkg Interface into the pkg abstraction used by $BASHTARD_NAME. del Remove a configuration playbook from this machine. ssh Run a given command on all known hosts. sync Pull latest changes through git, and synchronize all added diff --git a/lib/subcommands/pkg.bash b/lib/subcommands/pkg.bash new file mode 100644 index 0000000..ff5e33f --- /dev/null +++ b/lib/subcommands/pkg.bash @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: 2022 Patrick Spek +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +subcommand() { + local action + + action="$1" ; shift + + for package in "$@" + do + pkg "$action" "$package" + done +} -- cgit v1.1