From 680daec30066e1cd232737b3d6efc8e332dedc7d Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Thu, 13 Mar 2025 22:29:05 +0100 Subject: [PATCH] Add group commands --- Makefile | 11 +++++--- composer.lock | 4 +-- distropack.yaml | 22 +++++++++++++++ doc/slotcli.1.md | 32 ++++++++++++++++++++++ src/Application.php | 3 +++ src/Command/Group/GroupFindCommand.php | 37 ++++++++++++++++++++++++++ src/Command/Group/GroupShowCommand.php | 37 ++++++++++++++++++++++++++ 7 files changed, 141 insertions(+), 5 deletions(-) create mode 100644 distropack.yaml create mode 100644 doc/slotcli.1.md create mode 100644 src/Command/Group/GroupFindCommand.php create mode 100644 src/Command/Group/GroupShowCommand.php diff --git a/Makefile b/Makefile index d5797a6..183d296 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,18 @@ -.PHONY: help all phar +.PHONY: help all phar deb help: @echo "\e[1mTargets:\e[0m" - @echo " \e[3mall\e[0m — build everything\n \e[3mphar\e[0m — build the phar" + @echo " \e[3mall\e[0m — build everything\n \e[3mphar\e[0m — build the phar\n \e[3mdeb\e[0m — build deb package" all: phar phar: - box compile + echo " '$(shell git describe --tags)', 'builddate' => '$(shell date)' ];" > src/build.php \ + && box compile \ + && echo "yay" + rm -f src/build.php mv bin/slotcli.phar ./slotcli.phar +deb: + dpack build --type deb diff --git a/composer.lock b/composer.lock index 1c7bdbe..6dae05e 100644 --- a/composer.lock +++ b/composer.lock @@ -594,7 +594,7 @@ "source": { "type": "git", "url": "../slotdb-client-php", - "reference": "43d5db56cfc22486b00415079664b5fbc2392b4e" + "reference": "f3d6e3e7b3a8daa3111e27407f13ba8c56bf997f" }, "require": { "psr/http-client": "^1.0" @@ -620,7 +620,7 @@ } ], "description": "SlotDB PHP Client", - "time": "2025-03-13T16:14:01+00:00" + "time": "2025-03-13T18:11:29+00:00" }, { "name": "symfony/console", diff --git a/distropack.yaml b/distropack.yaml new file mode 100644 index 0000000..e301c4c --- /dev/null +++ b/distropack.yaml @@ -0,0 +1,22 @@ +dpack: + version: '1.0' +package: + package: slotdb-cli + priority: optional + section: misc + maintainer: 'NoccyLabs ' + architecture: all + version: + from: git-tag + depends: [ php-cli ] + summary: 'A database to manage properties on a fixed set of slots (CLI utility)' + description: Experimental. +files: + ./slotcli.phar: + target: /usr/bin/slotcli + chmod: '0744' + build: + - 'make phar' + ./doc/slotcli.1.md: + target: /usr/share/man/man1/slotcli.1.gz + type: manpage diff --git a/doc/slotcli.1.md b/doc/slotcli.1.md new file mode 100644 index 0000000..b4d3927 --- /dev/null +++ b/doc/slotcli.1.md @@ -0,0 +1,32 @@ +% slotcli(1) 1.0.0 | slotcli 0.1.0 +% Christopher Vagnetoft +% January 2025 + +# NAME +slotcli - SlotDB database daemon CLI utility + +# SYNOPSIS +**slotcli** [*OPTIONS*]\ +**slotcli** \-h + +# DESCRIPTION +**slotcli** is a CLI for SlotDB + +# OPTIONS +**\-h**, **\-\-help** +: Display help + + +# EXAMPLES +**slotcli** +: Show available commands + +# EXIT VALUES +**0** +: Success + +# BUGS +Probably + +# COPYRIGHT +Copyright (c) 2025, NoccyLabs. Licensed under GPL version 3 or later. diff --git a/src/Application.php b/src/Application.php index 960896e..0d28206 100644 --- a/src/Application.php +++ b/src/Application.php @@ -20,6 +20,9 @@ class Application extends \Symfony\Component\Console\Application $this->add(new Command\Slot\SlotQueryCommand($client)); $this->add(new Command\Slot\SlotFindCommand($client)); $this->add(new Command\Slot\SlotSetCommand($client)); + + $this->add(new Command\Group\GroupFindCommand($client)); + $this->add(new Command\Group\GroupShowCommand($client)); } } diff --git a/src/Command/Group/GroupFindCommand.php b/src/Command/Group/GroupFindCommand.php new file mode 100644 index 0000000..38158eb --- /dev/null +++ b/src/Command/Group/GroupFindCommand.php @@ -0,0 +1,37 @@ +client->findGroups(); + + var_dump($groups); + + return self::SUCCESS; + } +} diff --git a/src/Command/Group/GroupShowCommand.php b/src/Command/Group/GroupShowCommand.php new file mode 100644 index 0000000..208c3f9 --- /dev/null +++ b/src/Command/Group/GroupShowCommand.php @@ -0,0 +1,37 @@ +client->findGroups(); + + var_dump($groups); + + return self::SUCCESS; + } +}