diff --git a/README.md b/README.md index 225ed8c7..1e811677 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,8 @@ mouse: true pager: true # at which column should we word wrap? width: 80 +# show all files, including hidden and ignored. +all: true ``` ## Feedback diff --git a/config_cmd.go b/config_cmd.go index d3defcc7..e7376965 100644 --- a/config_cmd.go +++ b/config_cmd.go @@ -21,6 +21,8 @@ mouse: false pager: false # word-wrap at width width: 80 +# show all files, including hidden and ignored. +all: true ` var configCmd = &cobra.Command{ diff --git a/main.go b/main.go index 8a5ca903..fb3ce57e 100644 --- a/main.go +++ b/main.go @@ -146,6 +146,7 @@ func validateOptions(cmd *cobra.Command) error { width = viper.GetUint("width") mouse = viper.GetBool("mouse") pager = viper.GetBool("pager") + showAllFiles = viper.GetBool("all") preserveNewLines = viper.GetBool("preserveNewLines") // validate the glamour style @@ -373,10 +374,11 @@ func init() { _ = viper.BindPFlag("mouse", rootCmd.Flags().Lookup("mouse")) _ = viper.BindPFlag("preserveNewLines", rootCmd.Flags().Lookup("preserve-new-lines")) _ = viper.BindPFlag("showLineNumbers", rootCmd.Flags().Lookup("line-numbers")) - _ = viper.BindPFlag("showAllFiles", rootCmd.Flags().Lookup("all")) + _ = viper.BindPFlag("all", rootCmd.Flags().Lookup("all")) viper.SetDefault("style", styles.AutoStyle) viper.SetDefault("width", 0) + viper.SetDefault("all", true) rootCmd.AddCommand(configCmd, manCmd) }