in cmd/release-notes/main.go [62:273]
func init() {
// githubBaseURL contains the github base URL.
cmd.PersistentFlags().StringVar(
&opts.GithubBaseURL,
"github-base-url",
env.Default("GITHUB_BASE_URL", ""),
"Base URL of github",
)
// githubUploadURL contains the github upload URL.
cmd.PersistentFlags().StringVar(
&opts.GithubUploadURL,
"github-upload-url",
env.Default("GITHUB_UPLOAD_URL", ""),
"Upload URL of github",
)
// githubOrg contains name of github organization that holds the repo to scrape.
cmd.PersistentFlags().StringVar(
&opts.GithubOrg,
"org",
env.Default("ORG", notes.DefaultOrg),
"Name of github organization",
)
// githubRepo contains name of github repository to scrape.
cmd.PersistentFlags().StringVar(
&opts.GithubRepo,
"repo",
env.Default("REPO", notes.DefaultRepo),
"Name of github repository",
)
// output contains the path on the filesystem to where the resultant
// release notes should be printed.
cmd.PersistentFlags().StringVar(
&releaseNotesOpts.outputFile,
"output",
env.Default("OUTPUT", ""),
"The path to the where the release notes will be printed",
)
// branch is which branch to scrape.
cmd.PersistentFlags().StringVar(
&opts.Branch,
"branch",
env.Default("BRANCH", git.DefaultBranch),
fmt.Sprintf("Select which branch to scrape. Defaults to `%s`", git.DefaultBranch),
)
// startSHA contains the commit SHA where the release note generation
// begins.
cmd.PersistentFlags().StringVar(
&opts.StartSHA,
"start-sha",
env.Default("START_SHA", ""),
"The commit hash to start at",
)
// endSHA contains the commit SHA where the release note generation ends.
cmd.PersistentFlags().StringVar(
&opts.EndSHA,
"end-sha",
env.Default("END_SHA", ""),
"The commit hash to end at",
)
// startRev contains any valid git object where the release note generation
// begins. Can be used as alternative to start-sha.
cmd.PersistentFlags().StringVar(
&opts.StartRev,
"start-rev",
env.Default("START_REV", ""),
"The git revision to start at. Can be used as alternative to start-sha.",
)
// endRev contains any valid git object where the release note generation
// ends. Can be used as alternative to start-sha.
cmd.PersistentFlags().StringVar(
&opts.EndRev,
"end-rev",
env.Default("END_REV", ""),
"The git revision to end at. Can be used as alternative to end-sha.",
)
// repoPath contains the path to a local Kubernetes repository to avoid the
// delay during git clone
cmd.PersistentFlags().StringVar(
&opts.RepoPath,
"repo-path",
env.Default("REPO_PATH", filepath.Join(os.TempDir(), "k8s-repo")),
"Path to a local Kubernetes repository, used only for tag discovery.",
)
// format is the output format to produce the notes in.
cmd.PersistentFlags().StringVar(
&opts.Format,
"format",
env.Default("FORMAT", options.FormatMarkdown),
fmt.Sprintf("The format for notes output (options: %s)",
strings.Join([]string{
options.FormatJSON,
options.FormatMarkdown,
}, ", "),
),
)
// go-template is the go template to be used when the format is markdown
cmd.PersistentFlags().StringVar(
&opts.GoTemplate,
"go-template",
env.Default("GO_TEMPLATE", options.GoTemplateDefault),
fmt.Sprintf("The go template to be used if --format=markdown (options: %s)",
strings.Join([]string{
options.GoTemplateDefault,
options.GoTemplateInline + "<template>",
options.GoTemplatePrefix + "<file.template>",
}, ", "),
),
)
cmd.PersistentFlags().BoolVar(
&opts.AddMarkdownLinks,
"markdown-links",
env.IsSet("MARKDOWN_LINKS"),
"Add links for PRs and authors are added in the markdown format",
)
cmd.PersistentFlags().StringVar(
&opts.RequiredAuthor,
"required-author",
env.Default("REQUIRED_AUTHOR", "k8s-ci-robot"),
"Only commits from this GitHub user are considered. Set to empty string to include all users",
)
cmd.PersistentFlags().BoolVar(
&opts.Debug,
"debug",
env.IsSet("DEBUG"),
"Enable debug logging",
)
cmd.PersistentFlags().StringVar(
&opts.DiscoverMode,
"discover",
env.Default("DISCOVER", options.RevisionDiscoveryModeNONE),
fmt.Sprintf("The revision discovery mode for automatic revision retrieval (options: %s)",
strings.Join([]string{
options.RevisionDiscoveryModeNONE,
options.RevisionDiscoveryModeMergeBaseToLatest,
options.RevisionDiscoveryModePatchToPatch,
options.RevisionDiscoveryModeMinorToMinor,
}, ", "),
),
)
cmd.PersistentFlags().StringVar(
&opts.ReleaseBucket,
"release-bucket",
env.Default("RELEASE_BUCKET", release.ProductionBucket),
"Specify gs bucket to point to in generated notes",
)
cmd.PersistentFlags().StringVar(
&opts.ReleaseTars,
"release-tars",
env.Default("RELEASE_TARS", ""),
"Directory of tars to sha512 sum for display",
)
cmd.PersistentFlags().BoolVar(
&releaseNotesOpts.tableOfContents,
"toc",
env.IsSet("TOC"),
"Enable the rendering of the table of contents",
)
cmd.PersistentFlags().StringVar(
&opts.RecordDir,
"record",
env.Default("RECORD", ""),
"Record the API into a directory",
)
cmd.PersistentFlags().StringVar(
&opts.ReplayDir,
"replay",
env.Default("REPLAY", ""),
"Replay a previously recorded API from a directory",
)
cmd.PersistentFlags().BoolVar(
&releaseNotesOpts.dependencies,
"dependencies",
true,
"Add dependency report",
)
cmd.PersistentFlags().StringSliceVarP(
&opts.MapProviderStrings,
"maps-from",
"m",
[]string{},
"specify a location to recursively look for release notes *.y[a]ml file mappings",
)
cmd.PersistentFlags().BoolVar(
&opts.ListReleaseNotesV2,
"list-v2",
false,
"enable experimental implementation to list commits (ListReleaseNotesV2)",
)
}