Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.

Commit 8bbffd6

Browse files
Merge pull request #6 from tadashi-aikawa/0.5.2
0.5.2
2 parents d9e3a04 + b61bebc commit 8bbffd6

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,6 @@ You have to create PR and merge.
182182
After you merged PR, then
183183

184184
```
185-
$ make release version=x.y.z
185+
$ make deploy version=x.y.z
186186
```
187187

args.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"github.com/pkg/errors"
66
)
77

8-
const version = "0.5.1"
8+
const version = "0.5.2"
99
const usage = `Gowl.
1010
1111
Usage:
@@ -41,19 +41,23 @@ type Args struct {
4141
}
4242

4343
// CreateArgs creates Args
44-
func CreateArgs(usage string, argv []string, version string) (Args, error) {
44+
func CreateArgs(usage string, argv []string, version string) (Args, bool, error) {
4545
parser := &docopt.Parser{
4646
HelpHandler: docopt.PrintHelpOnly,
4747
OptionsFirst: false,
4848
}
4949

5050
opts, err := parser.ParseArgs(usage, argv, version)
5151
if err != nil {
52-
return Args{}, errors.Wrap(err, "Fail to parse arguments.")
52+
return Args{}, false, errors.Wrap(err, "Fail to parse arguments.")
53+
}
54+
55+
if len(opts) == 0 {
56+
return Args{}, true, nil
5357
}
5458

5559
var args Args
5660
opts.Bind(&args)
5761

58-
return args, nil
62+
return args, false, nil
5963
}

main.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ func getRoot(config Config) string {
2727
}
2828

2929
func main() {
30-
args, err := CreateArgs(usage, os.Args[1:], version)
30+
args, appEnd, err := CreateArgs(usage, os.Args[1:], version)
3131
if err != nil {
3232
log.Fatal(errors.Wrap(err, "Fail to create arguments."))
3333
}
34+
if appEnd {
35+
return
36+
}
3437

3538
config, err := CreateConfig()
3639
if err != nil {
@@ -62,5 +65,4 @@ func main() {
6265
log.Fatal(errors.Wrap(err, "Fail to command `list`"))
6366
}
6467
}
65-
6668
}

0 commit comments

Comments
 (0)