fixed len 1 and 0 args and flags
This commit is contained in:
parent
06544fa371
commit
aad4da3077
@ -36,8 +36,11 @@ func parse(input string) Input {
|
||||
var flags []string
|
||||
var args []string
|
||||
for _, arg := range split[1:] {
|
||||
if len(arg) == 1 && arg[0] == '-' {
|
||||
continue
|
||||
if len(arg) == 1 {
|
||||
if arg[0] == '-' {
|
||||
continue
|
||||
}
|
||||
_ = append(args, string(arg[0]))
|
||||
} else if arg[0:2] == "--" {
|
||||
var result = strings.TrimSpace(arg)
|
||||
flags = append(flags, string(result[2:]))
|
||||
@ -99,7 +102,7 @@ func input_str(env *environment.Env) string {
|
||||
history_index++
|
||||
input = env.History[history_index]
|
||||
} else {
|
||||
history_index = len(env.History)-1
|
||||
history_index = len(env.History) - 1
|
||||
input = ""
|
||||
if r, _, _ := reader.ReadRune(); r == 65 { // UPP
|
||||
if history_index > 0 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user