@@ -56,8 +56,13 @@ func NewSamplesCommand(clients *shared.ClientFactory) *cobra.Command {
5656 },
5757 }
5858
59- cmd . Flags (). StringVarP ( & samplesTemplateURLFlag , "template" , "t" , "" , "template URL for your app" )
59+ // DEPRECATED(semver:major): Prefer the create command when repository details are known
6060 cmd .Flags ().StringVarP (& samplesGitBranchFlag , "branch" , "b" , "" , "name of git branch to checkout" )
61+ cmd .Flag ("branch" ).Hidden = true
62+ // DEPRECATED(semver:major): Prefer the create command when repository details are known
63+ cmd .Flags ().StringVarP (& samplesTemplateURLFlag , "template" , "t" , "" , "template URL for your app" )
64+ cmd .Flag ("template" ).Hidden = true
65+
6166 cmd .Flags ().StringVar (& samplesLanguageFlag , "language" , "" , "runtime for the app framework\n ex: \" deno\" , \" node\" , \" python\" " )
6267 cmd .Flags ().BoolVar (& samplesListFlag , "list" , false , "prints samples without interactivity" )
6368
@@ -67,6 +72,12 @@ func NewSamplesCommand(clients *shared.ClientFactory) *cobra.Command {
6772// runSamplesCommand prompts for a sample then clones with the create command
6873func runSamplesCommand (clients * shared.ClientFactory , cmd * cobra.Command , args []string ) error {
6974 ctx := cmd .Context ()
75+
76+ // DEPRECATED(semver:major): Prefer the create command when repository details are known
77+ if cmd .Flag ("branch" ).Changed || cmd .Flag ("template" ).Changed {
78+ clients .IO .PrintWarning (ctx , "DEPRECATED: The `--branch` and `--template` flags are deprecated for the `samples` command; use the `create` command instead" )
79+ }
80+
7081 sampler := api .NewHTTPClient (api.HTTPClientOptions {
7182 TotalTimeOut : 60 * time .Second ,
7283 })
0 commit comments