initial commit

This commit is contained in:
2026-04-07 18:58:24 +02:00
commit 6daf2f953f
9 changed files with 532 additions and 0 deletions

34
cmd/ripsort.go Normal file
View File

@@ -0,0 +1,34 @@
package cmd
import (
ripsort "git.kapelle.org/niklas/ripsort/internal"
"github.com/alexflint/go-arg"
)
type InfoCmd struct {
File string `arg:"positional,required"`
}
type SortCmd struct {
Dst string `arg:"positional,required"`
Path string `arg:"positional,required"`
}
type args struct {
Info *InfoCmd `arg:"subcommand:info"`
Sort *SortCmd `arg:"subcommand:sort"`
}
func Run() {
var args args
p := arg.MustParse(&args)
switch {
case args.Info != nil:
ripsort.Scan(args.Info.File)
case args.Sort != nil:
ripsort.Sort(args.Sort.Dst, args.Sort.Path)
default:
p.Fail("Must specify command")
}
}