added verbose flag
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"log/slog"
|
||||||
|
|
||||||
ripsort "git.kapelle.org/niklas/ripsort/internal"
|
ripsort "git.kapelle.org/niklas/ripsort/internal"
|
||||||
"github.com/alexflint/go-arg"
|
"github.com/alexflint/go-arg"
|
||||||
)
|
)
|
||||||
@@ -17,12 +19,17 @@ type SortCmd struct {
|
|||||||
type args struct {
|
type args struct {
|
||||||
Info *InfoCmd `arg:"subcommand:info"`
|
Info *InfoCmd `arg:"subcommand:info"`
|
||||||
Sort *SortCmd `arg:"subcommand:sort"`
|
Sort *SortCmd `arg:"subcommand:sort"`
|
||||||
|
Verbose bool `arg:"-v" default:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func Run() {
|
func Run() {
|
||||||
var args args
|
var args args
|
||||||
p := arg.MustParse(&args)
|
p := arg.MustParse(&args)
|
||||||
|
|
||||||
|
if args.Verbose {
|
||||||
|
slog.SetLogLoggerLevel(slog.LevelDebug)
|
||||||
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case args.Info != nil:
|
case args.Info != nil:
|
||||||
ripsort.Scan(args.Info.File)
|
ripsort.Scan(args.Info.File)
|
||||||
|
|||||||
Reference in New Issue
Block a user