From 5a58be10c8ef1dfc7b03154519e7e2405a8aa7ef Mon Sep 17 00:00:00 2001 From: "Thomas G. Lopes" Date: Wed, 4 Mar 2026 21:21:44 +0000 Subject: [PATCH] improve conflict error messages, add -v to usage --- main.go | 1 + ops.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 2c17e07..ef06235 100644 --- a/main.go +++ b/main.go @@ -56,6 +56,7 @@ func usage() { fmt.Println(" sigil unlink [--dry-run]") fmt.Println(" sigil remove [--dry-run]") fmt.Println(" sigil status") + fmt.Println(" sigil -v, --version") } func applyCmd(args []string) error { diff --git a/ops.go b/ops.go index 0e41648..8f232e6 100644 --- a/ops.go +++ b/ops.go @@ -63,9 +63,9 @@ func linkFile(src, dst string) error { if current == src { return nil } - return fmt.Errorf("conflict at %s (points to %s)", dst, current) + return fmt.Errorf("conflict at %s (symlink points to %s, expected %s). Run 'sigil unlink %s' to restore and remove the conflicting link", dst, current, src, dst) } - return fmt.Errorf("conflict at %s (exists and is not a symlink)", dst) + return fmt.Errorf("conflict at %s (file exists and is not a symlink). Back up or remove this file first", dst) } else if !errors.Is(err, os.ErrNotExist) { return err }