Work on conversion of args parsing to go code

This commit is contained in:
Kovid Goyal
2022-08-30 00:21:59 +05:30
parent 441e4edfb2
commit 79c8862d4c
32 changed files with 274 additions and 66 deletions

20
tools/cmd/at/env.go Normal file
View File

@@ -0,0 +1,20 @@
// License: GPLv3 Copyright: 2022, Kovid Goyal, <kovid at kovidgoyal.net>
package at
import (
"kitty/tools/utils"
)
func parse_key_val_args(args []string) map[string]string {
ans := make(map[string]string, len(args))
for _, arg := range args {
key, value, found := utils.Cut(arg, "=")
if found {
ans[key] = value
} else {
ans[key+"="] = ""
}
}
return ans
}