commands: Make first letter of flags' usage lowercase

This commit is contained in:
Albert Nigmatzianov 2017-04-26 21:58:10 +02:00 committed by Bjørn Erik Pedersen
parent 8fbec59930
commit f0f69d03c5
6 changed files with 24 additions and 24 deletions

View file

@ -62,8 +62,8 @@ or just source them in directly:
} }
func init() { func init() {
genautocompleteCmd.PersistentFlags().StringVarP(&autocompleteTarget, "completionfile", "", "/etc/bash_completion.d/hugo.sh", "Autocompletion file") genautocompleteCmd.PersistentFlags().StringVarP(&autocompleteTarget, "completionfile", "", "/etc/bash_completion.d/hugo.sh", "autocompletion file")
genautocompleteCmd.PersistentFlags().StringVarP(&autocompleteType, "type", "", "bash", "Autocompletion type (currently only bash supported)") genautocompleteCmd.PersistentFlags().StringVarP(&autocompleteType, "type", "", "bash", "autocompletion type (currently only bash supported)")
// For bash-completion // For bash-completion
genautocompleteCmd.PersistentFlags().SetAnnotation("completionfile", cobra.BashCompFilenameExt, []string{}) genautocompleteCmd.PersistentFlags().SetAnnotation("completionfile", cobra.BashCompFilenameExt, []string{})

View file

@ -41,7 +41,7 @@ func createGenDocsHelper() *genDocsHelper {
return g.generate() return g.generate()
} }
g.cmd.PersistentFlags().StringVarP(&g.target, "dir", "", "docs/data", "Data dir") g.cmd.PersistentFlags().StringVarP(&g.target, "dir", "", "docs/data", "data dir")
return g return g
} }

View file

@ -218,35 +218,35 @@ func initRootPersistentFlags() {
// initHugoBuildCommonFlags initialize common flags related to the Hugo build. // initHugoBuildCommonFlags initialize common flags related to the Hugo build.
// Called by initHugoBuilderFlags. // Called by initHugoBuilderFlags.
func initHugoBuildCommonFlags(cmd *cobra.Command) { func initHugoBuildCommonFlags(cmd *cobra.Command) {
cmd.Flags().Bool("cleanDestinationDir", false, "Remove files from destination not found in static directories") cmd.Flags().Bool("cleanDestinationDir", false, "remove files from destination not found in static directories")
cmd.Flags().BoolP("buildDrafts", "D", false, "include content marked as draft") cmd.Flags().BoolP("buildDrafts", "D", false, "include content marked as draft")
cmd.Flags().BoolP("buildFuture", "F", false, "include content with publishdate in the future") cmd.Flags().BoolP("buildFuture", "F", false, "include content with publishdate in the future")
cmd.Flags().BoolP("buildExpired", "E", false, "include expired content") cmd.Flags().BoolP("buildExpired", "E", false, "include expired content")
cmd.Flags().Bool("disable404", false, "Do not render 404 page") cmd.Flags().Bool("disable404", false, "do not render 404 page")
cmd.Flags().Bool("disableRSS", false, "Do not build RSS files") cmd.Flags().Bool("disableRSS", false, "do not build RSS files")
cmd.Flags().Bool("disableSitemap", false, "Do not build Sitemap file") cmd.Flags().Bool("disableSitemap", false, "do not build Sitemap file")
cmd.Flags().StringVarP(&source, "source", "s", "", "filesystem path to read files relative from") cmd.Flags().StringVarP(&source, "source", "s", "", "filesystem path to read files relative from")
cmd.Flags().StringVarP(&contentDir, "contentDir", "c", "", "filesystem path to content directory") cmd.Flags().StringVarP(&contentDir, "contentDir", "c", "", "filesystem path to content directory")
cmd.Flags().StringVarP(&layoutDir, "layoutDir", "l", "", "filesystem path to layout directory") cmd.Flags().StringVarP(&layoutDir, "layoutDir", "l", "", "filesystem path to layout directory")
cmd.Flags().StringVarP(&cacheDir, "cacheDir", "", "", "filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/") cmd.Flags().StringVarP(&cacheDir, "cacheDir", "", "", "filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/")
cmd.Flags().BoolP("ignoreCache", "", false, "Ignores the cache directory") cmd.Flags().BoolP("ignoreCache", "", false, "ignores the cache directory")
cmd.Flags().StringVarP(&destination, "destination", "d", "", "filesystem path to write files to") cmd.Flags().StringVarP(&destination, "destination", "d", "", "filesystem path to write files to")
cmd.Flags().StringVarP(&theme, "theme", "t", "", "theme to use (located in /themes/THEMENAME/)") cmd.Flags().StringVarP(&theme, "theme", "t", "", "theme to use (located in /themes/THEMENAME/)")
cmd.Flags().StringVarP(&themesDir, "themesDir", "", "", "filesystem path to themes directory") cmd.Flags().StringVarP(&themesDir, "themesDir", "", "", "filesystem path to themes directory")
cmd.Flags().Bool("uglyURLs", false, "if true, use /filename.html instead of /filename/") cmd.Flags().Bool("uglyURLs", false, "if true, use /filename.html instead of /filename/")
cmd.Flags().Bool("canonifyURLs", false, "if true, all relative URLs will be canonicalized using baseURL") cmd.Flags().Bool("canonifyURLs", false, "if true, all relative URLs will be canonicalized using baseURL")
cmd.Flags().StringVarP(&baseURL, "baseURL", "b", "", "hostname (and path) to the root, e.g. http://spf13.com/") cmd.Flags().StringVarP(&baseURL, "baseURL", "b", "", "hostname (and path) to the root, e.g. http://spf13.com/")
cmd.Flags().Bool("enableGitInfo", false, "Add Git revision, date and author info to the pages") cmd.Flags().Bool("enableGitInfo", false, "add Git revision, date and author info to the pages")
cmd.Flags().BoolVar(&nitro.AnalysisOn, "stepAnalysis", false, "display memory and timing of different steps of the program") cmd.Flags().BoolVar(&nitro.AnalysisOn, "stepAnalysis", false, "display memory and timing of different steps of the program")
cmd.Flags().Bool("pluralizeListTitles", true, "Pluralize titles in lists using inflect") cmd.Flags().Bool("pluralizeListTitles", true, "pluralize titles in lists using inflect")
cmd.Flags().Bool("preserveTaxonomyNames", false, `Preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")`) cmd.Flags().Bool("preserveTaxonomyNames", false, `preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")`)
cmd.Flags().BoolP("forceSyncStatic", "", false, "Copy all files when static is changed.") cmd.Flags().BoolP("forceSyncStatic", "", false, "copy all files when static is changed.")
cmd.Flags().BoolP("noTimes", "", false, "Don't sync modification time of files") cmd.Flags().BoolP("noTimes", "", false, "don't sync modification time of files")
cmd.Flags().BoolP("noChmod", "", false, "Don't sync permission mode of files") cmd.Flags().BoolP("noChmod", "", false, "don't sync permission mode of files")
cmd.Flags().BoolVarP(&logI18nWarnings, "i18n-warnings", "", false, "Print missing translations") cmd.Flags().BoolVarP(&logI18nWarnings, "i18n-warnings", "", false, "print missing translations")
cmd.Flags().StringSliceVar(&disableKinds, "disableKinds", []string{}, "Disable different kind of pages (home, RSS etc.)") cmd.Flags().StringSliceVar(&disableKinds, "disableKinds", []string{}, "disable different kind of pages (home, RSS etc.)")
// Set bash-completion. // Set bash-completion.
// Each flag must first be defined before using the SetAnnotation() call. // Each flag must first be defined before using the SetAnnotation() call.
@ -263,8 +263,8 @@ func initBenchmarkBuildingFlags(cmd *cobra.Command) {
// init initializes flags. // init initializes flags.
func init() { func init() {
HugoCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose output") HugoCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose output")
HugoCmd.PersistentFlags().BoolVar(&logging, "log", false, "Enable Logging") HugoCmd.PersistentFlags().BoolVar(&logging, "log", false, "enable Logging")
HugoCmd.PersistentFlags().StringVar(&logFile, "logFile", "", "Log File path (if set, logging enabled automatically)") HugoCmd.PersistentFlags().StringVar(&logFile, "logFile", "", "log File path (if set, logging enabled automatically)")
HugoCmd.PersistentFlags().BoolVar(&verboseLog, "verboseLog", false, "verbose logging") HugoCmd.PersistentFlags().BoolVar(&verboseLog, "verboseLog", false, "verbose logging")
initRootPersistentFlags() initRootPersistentFlags()

View file

@ -58,7 +58,7 @@ Import from Jekyll requires two paths, e.g. ` + "`hugo import jekyll jekyll_root
} }
func init() { func init() {
importJekyllCmd.Flags().Bool("force", false, "Allow import into non-empty target directory") importJekyllCmd.Flags().Bool("force", false, "allow import into non-empty target directory")
} }
func importFromJekyll(cmd *cobra.Command, args []string) error { func importFromJekyll(cmd *cobra.Command, args []string) error {

View file

@ -41,9 +41,9 @@ var (
func init() { func init() {
newSiteCmd.Flags().StringVarP(&configFormat, "format", "f", "toml", "config & frontmatter format") newSiteCmd.Flags().StringVarP(&configFormat, "format", "f", "toml", "config & frontmatter format")
newSiteCmd.Flags().Bool("force", false, "Init inside non-empty directory") newSiteCmd.Flags().Bool("force", false, "init inside non-empty directory")
newCmd.Flags().StringVarP(&configFormat, "format", "f", "toml", "frontmatter format") newCmd.Flags().StringVarP(&configFormat, "format", "f", "toml", "frontmatter format")
newCmd.Flags().StringVarP(&contentType, "kind", "k", "", "Content type to create") newCmd.Flags().StringVarP(&contentType, "kind", "k", "", "content type to create")
newCmd.PersistentFlags().StringVarP(&source, "source", "s", "", "filesystem path to read files relative from") newCmd.PersistentFlags().StringVarP(&source, "source", "s", "", "filesystem path to read files relative from")
newCmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{}) newCmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{})
newCmd.Flags().StringVar(&contentEditor, "editor", "", "edit new content with this editor, if provided") newCmd.Flags().StringVar(&contentEditor, "editor", "", "edit new content with this editor, if provided")

View file

@ -50,9 +50,9 @@ func createReleaser() *releaseCommandeer {
return r.release() return r.release()
} }
r.cmd.PersistentFlags().IntVarP(&r.patchLevel, "patch", "p", 0, "Patch level, defaults to 0 for main releases") r.cmd.PersistentFlags().IntVarP(&r.patchLevel, "patch", "p", 0, "patch level, defaults to 0 for main releases")
r.cmd.PersistentFlags().IntVarP(&r.step, "step", "s", -1, "Release step, defaults to -1 for all steps.") r.cmd.PersistentFlags().IntVarP(&r.step, "step", "s", -1, "release step, defaults to -1 for all steps.")
r.cmd.PersistentFlags().BoolVarP(&r.skipPublish, "skip-publish", "", false, "Skip all publishing pipes of the release") r.cmd.PersistentFlags().BoolVarP(&r.skipPublish, "skip-publish", "", false, "skip all publishing pipes of the release")
return r return r
} }