From ef88a0798900968851013e5069bde36adf20bf27 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Fri, 28 Jan 2022 13:18:09 -0800 Subject: [PATCH] Collapse out single-use constant. Signed-off-by: Eric Promislow --- src/go/nerdctl-stub/parse_args.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/go/nerdctl-stub/parse_args.go b/src/go/nerdctl-stub/parse_args.go index 8bebb978243..224f10d2784 100644 --- a/src/go/nerdctl-stub/parse_args.go +++ b/src/go/nerdctl-stub/parse_args.go @@ -278,9 +278,8 @@ func init() { registerArgHandler("compose", "-f", filePathArgHandler) registerArgHandler("compose", "--project-directory", filePathArgHandler) registerArgHandler("compose", "--env-file", filePathArgHandler) - subcommands := []string{"build", "config", "down", "kill", "logs", "ps", "pull", "push", "up"} - for _, sc := range subcommands { - // No `-f` option because they aren't in the help for any of the `docker compose X` subcommands.:w + for _, sc := range []string{"build", "config", "down", "kill", "logs", "ps", "pull", "push", "up"} { + // No `-f` option because they aren't in the help for any of the `docker compose X` subcommands. registerArgHandler("compose " + sc, "--file", filePathArgHandler) registerArgHandler("compose " + sc, "--project-directory", filePathArgHandler) registerArgHandler("compose " + sc, "--env-file", filePathArgHandler)