mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 18:48:33 -04:00
chore: Cleaned up code.
This commit is contained in:
9
cli.odin
9
cli.odin
@@ -56,6 +56,7 @@ COMMANDS := []CommandInfo {
|
||||
},
|
||||
}
|
||||
|
||||
// FIXME: Works in kinda a wonky and awkward way.
|
||||
parse_args :: proc(args: []string) -> (cmd: Command, ok: bool) {
|
||||
if len(args) < 2 || args[1] == "--help" || args[1] == "-h" {
|
||||
print_usage()
|
||||
@@ -157,7 +158,12 @@ write_command_help :: proc(name: string, w: io.Writer) -> bool {
|
||||
fmt.wprintf(w, "\n%s\n", info.long, flush = false)
|
||||
}
|
||||
|
||||
fmt.wprintf(w, "\nFlags:\n -h, --help help for %s\n -c, --config-file <path> config file (default \"~/.envr/config.json\")\n", info.name, flush = false)
|
||||
fmt.wprintf(
|
||||
w,
|
||||
"\nFlags:\n -h, --help help for %s\n -c, --config-file <path> config file (default \"~/.envr/config.json\")\n",
|
||||
info.name,
|
||||
flush = false,
|
||||
)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -175,6 +181,7 @@ print_command_help :: proc(name: string) {
|
||||
bufio.writer_flush(&bw)
|
||||
}
|
||||
|
||||
// TODO: command args should be shown in usage.
|
||||
write_usage :: proc(w: io.Writer) {
|
||||
fmt.wprintf(
|
||||
w,
|
||||
|
||||
Reference in New Issue
Block a user