summaryrefslogtreecommitdiff
path: root/cmd/podman/system/service.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-22 20:14:19 +0200
committerGitHub <noreply@github.com>2020-05-22 20:14:19 +0200
commit4bc819328b898f57fa7c40d7d5f8dc5583ef5eef (patch)
tree7e55e6dbe5037ca446cea38cf398bcf63e8ba4d5 /cmd/podman/system/service.go
parentc8d64264c924833440237bf766a05db0cea56a1c (diff)
parente41089244b300af2b3e51ac1e9501b4cfe42264e (diff)
downloadpodman-4bc819328b898f57fa7c40d7d5f8dc5583ef5eef.tar.gz
podman-4bc819328b898f57fa7c40d7d5f8dc5583ef5eef.tar.bz2
podman-4bc819328b898f57fa7c40d7d5f8dc5583ef5eef.zip
Merge pull request #6341 from rhatdan/build6
Attempt to turn on additional build tests
Diffstat (limited to 'cmd/podman/system/service.go')
-rw-r--r--cmd/podman/system/service.go23
1 files changed, 15 insertions, 8 deletions
diff --git a/cmd/podman/system/service.go b/cmd/podman/system/service.go
index b5dd2f2aa..0f42ae28b 100644
--- a/cmd/podman/system/service.go
+++ b/cmd/podman/system/service.go
@@ -17,6 +17,7 @@ import (
"github.com/containers/libpod/pkg/util"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
+ "github.com/spf13/pflag"
)
var (
@@ -26,13 +27,12 @@ Enable a listening service for API access to Podman commands.
`
srvCmd = &cobra.Command{
- Use: "service [flags] [URI]",
- Args: cobra.MaximumNArgs(1),
- Short: "Run API service",
- Long: srvDescription,
- RunE: service,
- Example: `podman system service --time=0 unix:///tmp/podman.sock
- podman system service --varlink --time=0 unix:///tmp/podman.sock`,
+ Use: "service [flags] [URI]",
+ Args: cobra.MaximumNArgs(1),
+ Short: "Run API service",
+ Long: srvDescription,
+ RunE: service,
+ Example: `podman system service --time=0 unix:///tmp/podman.sock`,
}
srvArgs = struct {
@@ -50,10 +50,17 @@ func init() {
flags := srvCmd.Flags()
flags.Int64VarP(&srvArgs.Timeout, "time", "t", 5, "Time until the service session expires in seconds. Use 0 to disable the timeout")
- flags.Int64Var(&srvArgs.Timeout, "timeout", 5, "Time until the service session expires in seconds. Use 0 to disable the timeout")
flags.BoolVar(&srvArgs.Varlink, "varlink", false, "Use legacy varlink service instead of REST")
_ = flags.MarkDeprecated("varlink", "valink API is deprecated.")
+ flags.SetNormalizeFunc(aliasTimeoutFlag)
+}
+
+func aliasTimeoutFlag(_ *pflag.FlagSet, name string) pflag.NormalizedName {
+ if name == "timeout" {
+ name = "time"
+ }
+ return pflag.NormalizedName(name)
}
func service(cmd *cobra.Command, args []string) error {