diff --git a/README.md b/README.md index dc4259e..2871b61 100644 --- a/README.md +++ b/README.md @@ -131,10 +131,10 @@ Mount options: Resolve a Docspell item ID or web URL to the local mounted path: ```bash -docspell-cli get-local-path +docspell-cli get-path ``` -`get-local-path` automatically starts the configured mount in the background if it is not mounted yet. If an existing mount is stale, the tool attempts to unmount it and start a fresh one. +`get-path` automatically starts the configured mount in the background if it is not mounted yet. If an existing mount is stale, the tool attempts to unmount it and start a fresh one. Resolve a local mounted path, item ID, or item URL to the Docspell web URL: @@ -145,7 +145,7 @@ docspell-cli get-url Examples: ```bash -docspell-cli get-local-path https://docspell.example.com/app/item/abc123 +docspell-cli get-path https://docspell.example.com/app/item/abc123 docspell-cli get-url ~/mnt/docspell/Invoices/2026/07/example.pdf docspell-cli get-url abc123 ``` diff --git a/main.go b/main.go index c934851..20c2cc1 100644 --- a/main.go +++ b/main.go @@ -47,9 +47,9 @@ func main() { } return } - if len(os.Args) > 1 && os.Args[1] == "get-local-path" { - if err := runGetLocalPathCommand(os.Args[2:], cfg, password); err != nil { - fmt.Fprintln(os.Stderr, "get-local-path failed:", err) + if len(os.Args) > 1 && os.Args[1] == "get-path" { + if err := runGetPathCommand(os.Args[2:], cfg, password); err != nil { + fmt.Fprintln(os.Stderr, "get-path failed:", err) os.Exit(1) } return diff --git a/mount.go b/mount.go index 7154679..caad76c 100644 --- a/mount.go +++ b/mount.go @@ -132,13 +132,13 @@ func startMountInBackground(args []string, mountPoint string, quiet bool) error return nil } -func runGetLocalPathCommand(args []string, cfg config, password string) error { - flags := flag.NewFlagSet("get-local-path", flag.ExitOnError) +func runGetPathCommand(args []string, cfg config, password string) error { + flags := flag.NewFlagSet("get-path", flag.ExitOnError) if err := flags.Parse(args); err != nil { return err } if flags.NArg() != 1 { - return fmt.Errorf("usage: %s get-local-path ", filepath.Base(os.Args[0])) + return fmt.Errorf("usage: %s get-path ", filepath.Base(os.Args[0])) } mountPoint, err := ensureMounted(cfg, password) if err != nil {