Skip to content

Commit

Permalink
Add "verbose" flag
Browse files Browse the repository at this point in the history
  • Loading branch information
raitonoberu committed May 22, 2023
1 parent b5cc987 commit 565a129
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ var pipeCmd = &cobra.Command{
provider = hosted.New(conf.Host)
}

if FlagVerbose {
conf.IgnoreErrors = false
}

var ch = make(chan pool.Update)
go pool.Listen(player, provider, conf, ch)

Expand Down
8 changes: 8 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ var (
FlagStyleCurrent string
FlagStyleAfter string
FlagHAlignment string

FlagVerbose bool
)

var rootCmd = &cobra.Command{
Expand Down Expand Up @@ -117,6 +119,10 @@ var rootCmd = &cobra.Command{
conf.Style.HAlignment = FlagHAlignment
}

if FlagVerbose {
conf.IgnoreErrors = false
}

var ch = make(chan pool.Update)
go pool.Listen(player, provider, conf, ch)

Expand Down Expand Up @@ -170,6 +176,8 @@ func init() {
rootCmd.Flags().StringVar(&FlagStyleAfter, "after", "faint", "style of the lines after the current one")
rootCmd.Flags().StringVar(&FlagHAlignment, "halign", "center", "initial horizontal alignment (left/center/right)")

rootCmd.PersistentFlags().BoolVarP(&FlagVerbose, "verbose", "v", false, "force print errors")

rootCmd.AddCommand(pipeCmd)
}

Expand Down

0 comments on commit 565a129

Please sign in to comment.