github.com/telepresenceio/telepresence/v2@v2.20.0-pro.6.0.20240517030216-236ea954e789/pkg/client/cli/cmd/intercept.go (about) 1 package cmd 2 3 import ( 4 "github.com/spf13/cobra" 5 6 "github.com/telepresenceio/telepresence/v2/pkg/client/cli/ann" 7 "github.com/telepresenceio/telepresence/v2/pkg/client/cli/intercept" 8 ) 9 10 func interceptCmd() *cobra.Command { 11 ic := &intercept.Command{} 12 cmd := &cobra.Command{ 13 Use: "intercept [flags] <intercept_base_name> [-- <command with arguments...>]", 14 Args: cobra.MinimumNArgs(1), 15 Short: "Intercept a service", 16 Annotations: map[string]string{ 17 ann.Session: ann.Required, 18 ann.UpdateCheckFormat: ann.Tel2, 19 }, 20 SilenceUsage: true, 21 SilenceErrors: true, 22 RunE: ic.Run, 23 ValidArgsFunction: ic.ValidArgs, 24 } 25 ic.AddFlags(cmd) 26 return cmd 27 }