Skip to content

Commit

Permalink
add comment & changed position
Browse files Browse the repository at this point in the history
  • Loading branch information
noborus committed Aug 27, 2023
1 parent b261de9 commit a917a37
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var (
// config is the oviewer setting.
config oviewer.Config

// pattern is search pattern.
pattern string

// ver is version information.
Expand Down Expand Up @@ -304,6 +305,8 @@ func init() {
return []string{"bash", "zsh", "fish", "powershell"}, cobra.ShellCompDirectiveNoFileComp
})

rootCmd.PersistentFlags().StringVarP(&pattern, "pattern", "", "", "search pattern")

// Config.General
rootCmd.PersistentFlags().IntP("tab-width", "x", 8, "tab stop width")
_ = viper.BindPFlag("general.TabWidth", rootCmd.PersistentFlags().Lookup("tab-width"))
Expand Down Expand Up @@ -377,8 +380,6 @@ func init() {
rootCmd.PersistentFlags().StringP("jump-target", "j", "", "jump target `[int|int%|.int|'section']`")
_ = viper.BindPFlag("general.JumpTarget", rootCmd.PersistentFlags().Lookup("jump-target"))

rootCmd.PersistentFlags().StringVar(&pattern, "pattern", "", "search pattern")

// Config
rootCmd.PersistentFlags().BoolP("disable-mouse", "", false, "disable mouse support")
_ = viper.BindPFlag("DisableMouse", rootCmd.PersistentFlags().Lookup("disable-mouse"))
Expand Down

0 comments on commit a917a37

Please sign in to comment.