Skip to content

Commit

Permalink
Make --all configurable globally
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav (Stas) Katkov committed Sep 30, 2024
1 parent 67243bb commit 11eeac0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var (
pager bool
style string
width uint
all bool
showAllFiles bool
showLineNumbers bool
preserveNewLines bool
Expand Down Expand Up @@ -146,6 +147,7 @@ func validateOptions(cmd *cobra.Command) error {
width = viper.GetUint("width")
mouse = viper.GetBool("mouse")
pager = viper.GetBool("pager")
all = viper.GetBool("all")
preserveNewLines = viper.GetBool("preserveNewLines")

// validate the glamour style
Expand Down Expand Up @@ -315,7 +317,11 @@ func runTUI(workingDirectory string) error {

cfg.WorkingDirectory = workingDirectory

cfg.ShowAllFiles = showAllFiles
if showAllFiles {
cfg.ShowAllFiles = showAllFiles
} else {
cfg.ShowAllFiles = all
}
cfg.ShowLineNumbers = showLineNumbers
cfg.GlamourMaxWidth = width
cfg.GlamourStyle = style
Expand Down

0 comments on commit 11eeac0

Please sign in to comment.