Skip to content

Commit cb8560a

Browse files
committed
fix(cli): supporting more docker compose native cmds in stamusctl compose
1 parent 35e46ee commit cb8560a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

cmd/ctl/compose/update.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ func updateCmd() *cobra.Command {
2626
// Add flags
2727
flags.Version.AddAsFlag(cmd, false)
2828
flags.Config.AddAsFlag(cmd, false)
29+
flags.Template.AddAsFlag(cmd, false)
30+
2931
return cmd
3032
}
3133

@@ -39,12 +41,17 @@ func updateHandler(_ *cobra.Command, args []string) {
3941
if err != nil {
4042
return
4143
}
44+
templateFolder, err := flags.Template.GetValue()
45+
if err != nil {
46+
return
47+
}
48+
4249
// Call handler
4350
params := handlers.UpdateHandlerParams{
4451
Version: version.(string),
4552
Config: config.(string),
53+
TemplateFolder: templateFolder.(string),
4654
Args: args,
47-
TemplateFolder: "",
4855
}
4956

5057
handlers.UpdateHandler(params)

internal/docker-compose/wrapper.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ var ComposeFlags = models.ComposeFlags{
3434
[]string{"file"},
3535
[]string{"volumes", "remove-orphans"},
3636
),
37+
"restart": models.CreateComposeFlags(
38+
[]string{"file"},
39+
[]string{},
40+
),
3741
"ps": models.CreateComposeFlags(
3842
[]string{"file"},
3943
[]string{"services", "quiet", "format"},
4044
),
4145
"logs": models.CreateComposeFlags(
4246
[]string{"file"},
43-
[]string{"timestamps", "tail", "since", "until"},
47+
[]string{"timestamps", "tail", "since", "until", "follow", "details"},
4448
),
4549
"pull": models.CreateComposeFlags(
4650
[]string{"file"},
@@ -119,6 +123,7 @@ func WrappedCmd(composeFlags models.ComposeFlags) ([]*cobra.Command, map[string]
119123
func modifyFileFlag(c *cobra.Command) {
120124
// Modify flags
121125
c.Flags().Lookup("file").Hidden = true
126+
c.Flags().Lookup("file").Shorthand = ""
122127
stamusFlags.Config.AddAsFlag(c, false)
123128
// Save the command
124129
currentRunE := c.RunE

0 commit comments

Comments
 (0)