mirror of
https://github.com/charmbracelet/glow
synced 2025-03-04 14:57:13 +00:00
Display default value for config flag in --help
This commit is contained in:
parent
d5446bfddd
commit
61a2533d41
1 changed files with 4 additions and 1 deletions
5
main.go
5
main.go
|
@ -306,8 +306,11 @@ func init() {
|
|||
}
|
||||
rootCmd.Version = Version
|
||||
|
||||
scope := gap.NewScope(gap.User, "glow")
|
||||
defaultConfigFile, _ := scope.ConfigPath("glow.yml")
|
||||
|
||||
// "Glow Classic" cli arguments
|
||||
rootCmd.PersistentFlags().StringVar(&configFile, "config", "", "config file")
|
||||
rootCmd.PersistentFlags().StringVar(&configFile, "config", "", fmt.Sprintf("config file (default %s)", defaultConfigFile))
|
||||
rootCmd.Flags().BoolVarP(&pager, "pager", "p", false, "display with pager")
|
||||
rootCmd.Flags().StringVarP(&style, "style", "s", "auto", "style name or JSON path")
|
||||
rootCmd.Flags().UintVarP(&width, "width", "w", 0, "word-wrap at width")
|
||||
|
|
Loading…
Add table
Reference in a new issue