mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 10:38:33 -04:00
test: commands now accept stdout/stderr fields.
This commit is contained in:
@@ -6,13 +6,13 @@ import "core:strings"
|
||||
|
||||
cmd_remove :: proc(cmd: ^Command) {
|
||||
if len(cmd.args) != 1 {
|
||||
print_command_help("remove")
|
||||
print_command_help(cmd)
|
||||
return
|
||||
}
|
||||
|
||||
path := cmd.args[0]
|
||||
if len(strings.trim_space(path)) == 0 {
|
||||
fmt.println("Error: No path provided")
|
||||
fmt.wprintln(cmd.err, "Error: No path provided", flush = false)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ cmd_remove :: proc(cmd: ^Command) {
|
||||
} else {
|
||||
resolved, abs_err := filepath.abs(path)
|
||||
if abs_err != nil {
|
||||
fmt.printf("Error getting absolute path: %v\n", abs_err)
|
||||
fmt.wprintf(cmd.err, "Error getting absolute path: %v\n", abs_err, flush = false)
|
||||
return
|
||||
}
|
||||
abs_path = resolved
|
||||
@@ -39,6 +39,6 @@ cmd_remove :: proc(cmd: ^Command) {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.printf("Removed %s from the database\n", abs_path)
|
||||
fmt.wprintf(cmd.out, "Removed %s from the database\n", abs_path, flush = false)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user