修复macOS下mcadump不能用*指定多个文件的问题
This commit is contained in:
@ -22,16 +22,12 @@ func main() {
|
||||
flag.Parse()
|
||||
args := flag.Args()
|
||||
|
||||
var f, o string
|
||||
switch len(args) {
|
||||
default:
|
||||
var o string
|
||||
o = "."// output dir
|
||||
if len(args) < 2 {
|
||||
usage()
|
||||
case 1:
|
||||
f, o = args[0], "."
|
||||
case 2:
|
||||
f, o = args[0], args[1]
|
||||
}
|
||||
|
||||
for _, f := range args[1:] {
|
||||
fs, err := filepath.Glob(f)
|
||||
checkerr(err)
|
||||
|
||||
@ -44,10 +40,11 @@ func main() {
|
||||
unpack(f, o)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func usage() {
|
||||
_, _ = fmt.Fprintf(os.Stderr, "usage: %s [-x] [-r] r.<X>.<Z>.mc{a,c} [outdir]\n", flag.Arg(0))
|
||||
_, _ = fmt.Fprintf(os.Stderr, "usage: %s [-x] [-r] r.<X>.<Z>.mc{a,c}\n", flag.Arg(0))
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user