summaryrefslogtreecommitdiff
path: root/cmd/commands.go
diff options
context:
space:
mode:
authorOleg <musinit@yandex.ru>2021-08-12 02:31:41 +0300
committerGitHub <noreply@github.com>2021-08-11 17:31:41 -0600
commit68c5c71659109b10226f10873f7dc67102b9dc14 (patch)
treeba591e189bd369fffafe95418ff0a6ac1b0d7733 /cmd/commands.go
parent569ecdbd02a3bdf8589f785cca022240973dea4d (diff)
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 <lavofr@gmail.com>
Diffstat (limited to 'cmd/commands.go')
-rw-r--r--cmd/commands.go24
1 files changed, 24 insertions, 0 deletions
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: "<packages...>",
+ 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: "<packages...>",
+ 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.