feat(go): implement link with subdir and force handling

This commit is contained in:
Micheal Wilkinson
2026-03-19 13:46:48 +00:00
parent 41584dec6a
commit e733dff818
2 changed files with 170 additions and 4 deletions

View File

@@ -74,7 +74,14 @@ func Run(args []string, stdout io.Writer, stderr io.Writer) int {
return 1
}
return 0
case "link", "unlink", "track", "pull", "push", "commit", "destroy", "cd", "open", "exec", "exec_all", "rc", "generate":
case "link":
castle := defaultCastle(args)
if err := app.LinkCastle(castle); err != nil {
_, _ = fmt.Fprintf(stderr, "error: %v\n", err)
return 1
}
return 0
case "unlink", "track", "pull", "push", "commit", "destroy", "cd", "open", "exec", "exec_all", "rc", "generate":
_, _ = fmt.Fprintf(stderr, "error: %s is not implemented in Go yet\n", command)
return 2
default:
@@ -100,10 +107,11 @@ func printHelp(w io.Writer) {
_, _ = fmt.Fprintln(w, " show_path [CASTLE]")
_, _ = fmt.Fprintln(w, " status [CASTLE]")
_, _ = fmt.Fprintln(w, " diff [CASTLE]")
_, _ = fmt.Fprintln(w, " link [CASTLE]")
_, _ = fmt.Fprintln(w, " version | -v | --version")
_, _ = fmt.Fprintln(w, "")
_, _ = fmt.Fprintln(w, "Not implemented yet:")
_, _ = fmt.Fprintln(w, " link, unlink, track, pull, push, commit, destroy, cd, open, exec, exec_all, rc, generate")
_, _ = fmt.Fprintln(w, " unlink, track, pull, push, commit, destroy, cd, open, exec, exec_all, rc, generate")
_, _ = fmt.Fprintln(w, "")
_, _ = fmt.Fprintln(w, "Build: go build -o dist/homesick-go ./cmd/homesick")
}