Skip to content

Commit

Permalink
change flag
Browse files Browse the repository at this point in the history
  • Loading branch information
rbren authored and norwoodj committed Oct 6, 2020
1 parent de4bf77 commit 4b2522d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions cmd/helm-docs/command_line.go
Expand Up @@ -49,13 +49,8 @@ func newHelmDocsCommand(run func(cmd *cobra.Command, args []string)) (*cobra.Com
command.PersistentFlags().StringP("ignore-file", "i", ".helmdocsignore", "The filename to use as an ignore file to exclude chart directories")
command.PersistentFlags().StringP("log-level", "l", "info", logLevelUsage)
command.PersistentFlags().StringP("output-file", "o", "README.md", "markdown file path relative to each chart directory to which rendered documentation will be written")
<<<<<<< HEAD
command.PersistentFlags().StringP("sort-values-order", "s", document.AlphaNumSortOrder, fmt.Sprintf("order in which to sort the values table (\"%s\" or \"%s\")", document.AlphaNumSortOrder, document.FileSortOrder))
command.PersistentFlags().StringSliceP("template-files", "t", []string{"README.md.gotmpl"}, "gotemplate file paths relative to each chart directory from which documentation will be generated")
=======
command.PersistentFlags().StringP("template-file", "t", "README.md.gotmpl", "gotemplate file path relative to each chart directory from which documentation will be generated")
command.PersistentFlags().StringP("sort-values-order", "s", "alpha", "order in which to print the values (alpha or file)")
>>>>>>> 18b313e... change flag

viper.AutomaticEnv()
viper.SetEnvPrefix("HELM_DOCS")
Expand Down
6 changes: 3 additions & 3 deletions pkg/document/model.go
Expand Up @@ -55,7 +55,7 @@ func getChartTemplateData(chartDocumentationInfo helm.ChartDocumentationInfo, he

sortOrder := viper.GetString("sort-values-order")
if sortOrder == FileSortOrder {
sort.Slice(valuesTableRows[:], func(i, j int) bool {
sort.Slice(valuesTableRows, func(i, j int) bool {
if valuesTableRows[i].LineNumber < valuesTableRows[j].LineNumber {
return true
} else if valuesTableRows[i].Column < valuesTableRows[j].Column {
Expand All @@ -65,12 +65,12 @@ func getChartTemplateData(chartDocumentationInfo helm.ChartDocumentationInfo, he
return false
})
} else if sortOrder == AlphaNumSortOrder {
sort.Slice(valuesTableRows[:], func(i, j int) bool {
sort.Slice(valuesTableRows, func(i, j int) bool {
return valuesTableRows[i].Key < valuesTableRows[j].Key
})
} else {
log.Warnf("Invalid sort order provided %s, defaulting to %s", sortOrder, AlphaNumSortOrder)
sort.Slice(valuesTableRows[:], func(i, j int) bool {
sort.Slice(valuesTableRows, func(i, j int) bool {
return valuesTableRows[i].Key < valuesTableRows[j].Key
})
}
Expand Down

0 comments on commit 4b2522d

Please sign in to comment.