Skip to content

Commit b53dcf3

Browse files
authored
fix: generate command should parse the -push flag (#1744)
Fixes #1743
1 parent 5235d26 commit b53dcf3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

internal/librarian/flags.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ func addFlagWorkRoot(fs *flag.FlagSet, cfg *config.Config) {
6262
func addFlagPR(fs *flag.FlagSet, cfg *config.Config) {
6363
fs.StringVar(&cfg.PullRequest, "pr", "", "a pull request to operate on. It should be in the format of a uri https://github.com/{owner}/{repo}/pull/{number}. If not specified, will search for all merged pull requests with the label `release:pending` in the last 30 days.")
6464
}
65+
66+
func addFlagPush(fs *flag.FlagSet, cfg *config.Config) {
67+
fs.BoolVar(&cfg.Push, "push", false, "whether to push the generated code")
68+
}

internal/librarian/generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ func init() {
8484
addFlagLibrary(fs, cfg)
8585
addFlagRepo(fs, cfg)
8686
addFlagWorkRoot(fs, cfg)
87+
addFlagPush(fs, cfg)
8788
}
8889

8990
type generateRunner struct {

0 commit comments

Comments
 (0)