improve conflict error messages, add -v to usage

This commit is contained in:
2026-03-04 21:21:44 +00:00
parent dd8e3035df
commit 5a58be10c8
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -56,6 +56,7 @@ func usage() {
fmt.Println(" sigil unlink <package> [--dry-run]") fmt.Println(" sigil unlink <package> [--dry-run]")
fmt.Println(" sigil remove <package> [--dry-run]") fmt.Println(" sigil remove <package> [--dry-run]")
fmt.Println(" sigil status") fmt.Println(" sigil status")
fmt.Println(" sigil -v, --version")
} }
func applyCmd(args []string) error { func applyCmd(args []string) error {
+2 -2
View File
@@ -63,9 +63,9 @@ func linkFile(src, dst string) error {
if current == src { if current == src {
return nil 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) { } else if !errors.Is(err, os.ErrNotExist) {
return err return err
} }