Skip to content

Commit

Permalink
Handle paths in nerdctl compose subcommands
Browse files Browse the repository at this point in the history
Some of the commands have a 3-level structure:
`nerdctl COMMAND options.... SUBCOMMAND options...`

This change will WSL-convert paths that appear in the second set
of options.

Signed-off-by: Eric Promislow <[email protected]>
  • Loading branch information
ericpromislow committed Jan 28, 2022
1 parent 49d735b commit 7b868b4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/go/nerdctl-stub/parse_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@ 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
registerArgHandler("compose " + sc, "--file", filePathArgHandler)
registerArgHandler("compose " + sc, "--project-directory", filePathArgHandler)
registerArgHandler("compose " + sc, "--env-file", filePathArgHandler)
}
registerArgHandler("container run", "--cosign-key", filePathArgHandler)
registerArgHandler("container run", "--volume", volumeArgHandler)
registerArgHandler("container run", "-v", volumeArgHandler)
Expand Down

0 comments on commit 7b868b4

Please sign in to comment.