diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-10 22:41:47 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-10 22:41:47 +0300 |
| commit | bd749f8e9a0eeaa5578a368996f7b93955580a39 (patch) | |
| tree | 5d2e45a7a155cdecbbc7ee864a35e4818277714e /internal/askcli/formatter.go | |
| parent | dc71be943e25087905b2b9a4fec2fcf6b6f9925f (diff) | |
task 20: hide do info UUID unless HEXAI_DEBUG is set
Diffstat (limited to 'internal/askcli/formatter.go')
| -rw-r--r-- | internal/askcli/formatter.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/askcli/formatter.go b/internal/askcli/formatter.go index fc4a1d9..5d2ed76 100644 --- a/internal/askcli/formatter.go +++ b/internal/askcli/formatter.go @@ -3,6 +3,7 @@ package askcli import ( "fmt" "io" + "os" "slices" "strings" @@ -139,7 +140,9 @@ func detectTaskListTerminalWidth(w io.Writer) int { func FormatTaskInfo(t TaskExport, alias string, dependencyAliases map[string]string) string { var b strings.Builder fmt.Fprintf(&b, "ID: %s\n", alias) - fmt.Fprintf(&b, "UUID: %s\n", t.UUID) + if debugEnabled() { + fmt.Fprintf(&b, "UUID: %s\n", t.UUID) + } fmt.Fprintf(&b, "Description: %s\n", t.Description) fmt.Fprintf(&b, "Status: %s\n", t.Status) fmt.Fprintf(&b, "Started: %s\n", formatTaskStarted(t)) @@ -163,6 +166,11 @@ func FormatTaskInfo(t TaskExport, alias string, dependencyAliases map[string]str return b.String() } +func debugEnabled() bool { + _, ok := os.LookupEnv("HEXAI_DEBUG") + return ok +} + // FormatSuccess returns the success string written to stdout after a task command runs. func FormatSuccess(alias string) string { return fmt.Sprintf("ok %s\n", alias) |
