39 lines
724 B
Go
39 lines
724 B
Go
package cmd
|
|
|
|
import (
|
|
oplcli "git.kapelle.org/niklas/opl-cli/internal"
|
|
"github.com/alexflint/go-arg"
|
|
)
|
|
|
|
type ScanCmd struct {
|
|
File string `arg:"positional"`
|
|
}
|
|
|
|
type RenameCmd struct {
|
|
File string `arg:"positional"`
|
|
}
|
|
|
|
type ArtCmd struct {
|
|
File string `arg:"positional"`
|
|
}
|
|
|
|
type args struct {
|
|
Scan *ScanCmd `arg:"subcommand:scan"`
|
|
Rename *RenameCmd `arg:"subcommand:rename"`
|
|
Art *ArtCmd `arg:"subcommand:art"`
|
|
}
|
|
|
|
func Run() {
|
|
var args args
|
|
arg.MustParse(&args)
|
|
|
|
switch {
|
|
case args.Scan != nil:
|
|
oplcli.Scan(args.Scan.File, oplcli.Config{})
|
|
case args.Rename != nil:
|
|
oplcli.Rename(args.Rename.File, oplcli.Config{})
|
|
case args.Art != nil:
|
|
oplcli.DownloadGameArt(args.Art.File, oplcli.Config{})
|
|
}
|
|
}
|