From 68c5c71659109b10226f10873f7dc67102b9dc14 Mon Sep 17 00:00:00 2001 From: Oleg Date: Thu, 12 Aug 2021 02:31:41 +0300 Subject: cmd: New `add-package` and `remove-package` commands (#4226) * adding package command * add-package command name * refactoring duplicate code * fixed by review * fixed by review * remove-package command * commands in different files, common utils * fix add, remove, upgrade packages in 1 file * copyright and downloadPath moved * refactor * downloadPath do no export * adding/removing multiple packages * addPackages/removePackages, comments, command-desc * add-package, process case len(args) == 0 Co-authored-by: Francis Lavoie --- cmd/commands.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'cmd/commands.go') diff --git a/cmd/commands.go b/cmd/commands.go index 36e9c04..89c4fe4 100644 --- a/cmd/commands.go +++ b/cmd/commands.go @@ -291,6 +291,30 @@ Downloads an updated Caddy binary with the same modules/plugins at the latest versions. EXPERIMENTAL: May be changed or removed.`, }) + RegisterCommand(Command{ + Name: "add-package", + Func: cmdAddPackage, + Usage: "", + Short: "Adds Caddy packages (EXPERIMENTAL)", + Long: ` +Downloads an updated Caddy binary with the specified packages (module/plugin) +added. Retains existing packages. Returns an error if the any of packages are +already included. EXPERIMENTAL: May be changed or removed. +`, + }) + + RegisterCommand(Command{ + Name: "remove-package", + Func: cmdRemovePackage, + Usage: "", + Short: "Removes Caddy packages (EXPERIMENTAL)", + Long: ` +Downloads an updated Caddy binaries without the specified packages (module/plugin). +Returns an error if any of the packages are not included. +EXPERIMENTAL: May be changed or removed. +`, + }) + } // RegisterCommand registers the command cmd. -- cgit v1.2.3