Rename get-local-path subcommand to get-path

This commit is contained in:
Jan Bader
2026-07-20 20:30:36 +02:00
parent eda8ba9aab
commit aaf7be0b90
3 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -131,10 +131,10 @@ Mount options:
Resolve a Docspell item ID or web URL to the local mounted path: Resolve a Docspell item ID or web URL to the local mounted path:
```bash ```bash
docspell-cli get-local-path <item-id-or-web-url> docspell-cli get-path <item-id-or-web-url>
``` ```
`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: Resolve a local mounted path, item ID, or item URL to the Docspell web URL:
@@ -145,7 +145,7 @@ docspell-cli get-url <local-mounted-path-or-item-id>
Examples: Examples:
```bash ```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 ~/mnt/docspell/Invoices/2026/07/example.pdf
docspell-cli get-url abc123 docspell-cli get-url abc123
``` ```
+3 -3
View File
@@ -47,9 +47,9 @@ func main() {
} }
return return
} }
if len(os.Args) > 1 && os.Args[1] == "get-local-path" { if len(os.Args) > 1 && os.Args[1] == "get-path" {
if err := runGetLocalPathCommand(os.Args[2:], cfg, password); err != nil { if err := runGetPathCommand(os.Args[2:], cfg, password); err != nil {
fmt.Fprintln(os.Stderr, "get-local-path failed:", err) fmt.Fprintln(os.Stderr, "get-path failed:", err)
os.Exit(1) os.Exit(1)
} }
return return
+3 -3
View File
@@ -132,13 +132,13 @@ func startMountInBackground(args []string, mountPoint string, quiet bool) error
return nil return nil
} }
func runGetLocalPathCommand(args []string, cfg config, password string) error { func runGetPathCommand(args []string, cfg config, password string) error {
flags := flag.NewFlagSet("get-local-path", flag.ExitOnError) flags := flag.NewFlagSet("get-path", flag.ExitOnError)
if err := flags.Parse(args); err != nil { if err := flags.Parse(args); err != nil {
return err return err
} }
if flags.NArg() != 1 { if flags.NArg() != 1 {
return fmt.Errorf("usage: %s get-local-path <item-id-or-url>", filepath.Base(os.Args[0])) return fmt.Errorf("usage: %s get-path <item-id-or-url>", filepath.Base(os.Args[0]))
} }
mountPoint, err := ensureMounted(cfg, password) mountPoint, err := ensureMounted(cfg, password)
if err != nil { if err != nil {