mirror of
https://github.com/byReqz/go-etcher.git
synced 2024-11-22 15:01:16 +00:00
add nonflag argument handling
This commit is contained in:
parent
a7378b14e0
commit
8390130252
12
main.go
12
main.go
@ -96,11 +96,23 @@ func main() {
|
|||||||
s := spinner.New(spinner.CharSets[14], 100*time.Millisecond)
|
s := spinner.New(spinner.CharSets[14], 100*time.Millisecond)
|
||||||
|
|
||||||
if input == "" {
|
if input == "" {
|
||||||
|
if len(flag.Args()) == 0 {
|
||||||
input = GetPath()
|
input = GetPath()
|
||||||
|
} else if len(flag.Args()) > 0 {
|
||||||
|
input = flag.Args()[0]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if device == "" {
|
if device == "" {
|
||||||
|
if len(flag.Args()) == 0 {
|
||||||
device = GetDest()
|
device = GetDest()
|
||||||
|
} else if len(flag.Args()) > 0 {
|
||||||
|
if input == flag.Args()[0] && len(flag.Args()) > 1 {
|
||||||
|
device = flag.Args()[1]
|
||||||
|
} else if input != flag.Args()[0] && len(flag.Args()) > 0 {
|
||||||
|
device = flag.Args()[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Prefix = "[ "
|
s.Prefix = "[ "
|
||||||
|
Loading…
Reference in New Issue
Block a user