Skip to content

Commit b0d9dc3

Browse files
committed
chore(cli): remove unecessary flag
1 parent e1fea71 commit b0d9dc3

2 files changed

Lines changed: 2 additions & 31 deletions

File tree

cmd/main.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ type Command struct {
1919
}
2020

2121
func Run() {
22-
opts, ok := options.Run()
23-
if !ok {
24-
return
25-
}
22+
opts := options.Run()
2623

2724
if opts.Create {
2825
options.Create()

options/cli.go

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,17 @@ package options
22

33
import (
44
"flag"
5-
"fmt"
65
)
76

87
type Options struct {
9-
Build bool
108
Create bool
119
}
1210

13-
func Run() (Options, bool) {
14-
opts := parse()
15-
if !opts.check() {
16-
return opts, false
17-
}
18-
19-
return opts, true
20-
}
21-
22-
func parse() Options {
11+
func Run() Options {
2312
var create = flag.Bool("create", false, "Create a config file")
24-
var build = flag.Bool("build", false, "Build the CSS")
2513
flag.Parse()
2614

2715
return Options{
28-
Build: *build,
2916
Create: *create,
3017
}
3118
}
32-
33-
func (o Options) check() bool {
34-
if o.Build && o.Create {
35-
fmt.Println("You can't use both -build and -create")
36-
return false
37-
}
38-
39-
if !o.Build && !o.Create {
40-
o.Build = true
41-
}
42-
43-
return true
44-
}

0 commit comments

Comments
 (0)