Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/handlers/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package handlers
import (
"context"
"fmt"
"os"

"github.com/hdresearch/vers-cli/internal/app"
"github.com/hdresearch/vers-cli/internal/presenters"
Expand Down Expand Up @@ -30,7 +31,7 @@ func HandleKill(ctx context.Context, a *app.App, r KillReq) error {
// Confirm if needed
if !r.SkipConfirmation {
for _, t := range targets {
fmt.Printf("Warning: You are about to delete VM '%s'\n", t)
fmt.Fprintf(os.Stderr, "Warning: You are about to delete VM '%s'\n", t)
}
ok, _ := a.Prompter.YesNo("Proceed")
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion internal/handlers/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func performUpgrade(DebugPrint func(string, ...any), release *update.GitHubRelea
}
fmt.Println("Checksum verification passed")
} else if skipChecksum {
fmt.Println("warning: skipping checksum verification (not recommended)")
fmt.Fprintln(os.Stderr, "warning: skipping checksum verification (not recommended)")
}

currentExe, err := os.Executable()
Expand Down
5 changes: 3 additions & 2 deletions internal/presenters/branch_presenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package presenters

import (
"fmt"
"os"

"github.com/hdresearch/vers-cli/internal/app"
)
Expand All @@ -12,7 +13,7 @@ func RenderBranch(a *app.App, res BranchView) {
newIDs = []string{res.NewID}
}
if len(newIDs) == 0 {
fmt.Println("Error: no VM IDs returned from branch operation")
fmt.Fprintln(os.Stderr, "Error: no VM IDs returned from branch operation")
return
}
numNew := len(newIDs)
Expand Down Expand Up @@ -50,7 +51,7 @@ func RenderBranch(a *app.App, res BranchView) {
}

if res.CheckoutErr != nil {
fmt.Printf("WARNING: Failed to update HEAD: %v\n", res.CheckoutErr)
fmt.Fprintf(os.Stderr, "WARNING: Failed to update HEAD: %v\n", res.CheckoutErr)
return
}

Expand Down
3 changes: 2 additions & 1 deletion internal/presenters/run_presenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package presenters

import (
"fmt"
"os"

"github.com/hdresearch/vers-cli/internal/app"
)
Expand All @@ -18,6 +19,6 @@ func RenderRun(a *app.App, v RunView) {
if v.HeadTarget != "" {
fmt.Printf("HEAD now points to: %s\n", v.HeadTarget)
} else {
fmt.Println("Warning: .vers directory not found. Run 'vers init' first.")
fmt.Fprintln(os.Stderr, "Warning: .vers directory not found. Run 'vers init' first.")
}
}
2 changes: 1 addition & 1 deletion internal/runconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func Default() *Config {
func Load() (*Config, error) {
cfg := Default()
if _, err := os.Stat("vers.toml"); os.IsNotExist(err) {
fmt.Println("Warning: vers.toml not found, using default configuration")
fmt.Fprintln(os.Stderr, "Warning: vers.toml not found, using default configuration")
return cfg, nil
}
if _, err := toml.DecodeFile("vers.toml", cfg); err != nil {
Expand Down
Loading