[from now] 2014/08/25 21:32:01

diff --git a/cmd/copybackup/copybackup.go b/cmd/copybackup/copybackup.go
index bc1f6a1..a9bbd98 100644
--- a/cmd/copybackup/copybackup.go
+++ b/cmd/copybackup/copybackup.go
@@ -7,6 +7,7 @@ import (
 	"sync"

 	"github.com/jessevdk/go-flags"
+	"github.com/umisama/golog"
 	cb "github.com/yukimemi/copybackup"
 	core "github.com/yukimemi/gocore"
 )
@@ -25,22 +26,17 @@ func main() {
 	var wg sync.WaitGroup

 	opts := &Options{}
-	p := flags.NewParser(opts, flags.PrintErrors)
-
-	core.Logger.Debugf("g = %d", *g)
-	core.Logger.Debugf("b = %s", *b)
-	core.Logger.Debugf("s = %d", *s)
-	flags.Parse()
-
-	if flags.NArg() != 0 {
-		root = flags.Arg(0)
-	} else {
-		root, e = os.Getwd()
-		core.FailOnError(e)
-		flags.Usage()
+	parser := flags.NewParser(opts, flags.Default)
+	args, e := parser.Parse()
+	core.FailOnError(e)
+
+	if len(args) == 0 {
+		parser.WriteHelp(os.Stderr)
 		os.Exit(0)
 	}

+	root = args[0]
+
 	files, e := ioutil.ReadDir(root)
 	core.FailOnError(e)