mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-19 10:05:03 +01:00
feat(cli,core): shell completions with live values from the service
`pdfs completions <shell>` prints a completion script for bash, zsh, fish, elvish or PowerShell, built on clap_complete's dynamic engine: on Tab the shell calls `pdfs` back, which completes commands and options and also the values the running service knows, each with a description: paths in My files, synced-folder and queue ids, computers, trash, albums, items shared with me, invitations, bookmarks, conflict copies, and a file's versions or a share's members and public link once its path is typed. A completer that gets no answer from the service within two seconds offers nothing rather than hanging the prompt. Listings that ask Proton are kept for 30 s in $XDG_RUNTIME_DIR (0600), so repeated Tabs do not wait again. Completion is triggered by PDFS_COMPLETE rather than clap's generic COMPLETE, because the same binary runs the daemon. Share roles are now checked by the CLI before the request. The package recipes install the bash, zsh and fish scripts via packaging/completions.sh.
This commit is contained in:
1 parent
2b95708260
commit
ad648ab5cc
17 files changed
+975
-25
No files matched your search
@@ -29,6 +29,16 @@ Existing folders stay device backups. Older builds cannot open the upgraded data
|
||||
on Proton Drive is trashed or moved out of My files, syncing stops with an error and the local
|
||||
files stay. Attaching a folder is done from a terminal for now.
|
||||
|
||||
- **Tab completion for `pdfs`** in bash, zsh and fish, installed by every package. Besides
|
||||
commands and options it completes paths in My files (`pdfs pin Doc<Tab>`) and what the running
|
||||
service knows, each with a description: synced folders, queued changes, computers, trash, albums,
|
||||
items shared with you, invitations, bookmarks and conflict copies, and once a path is typed, the
|
||||
file's versions or the share's members and link. Without the service it still completes commands
|
||||
and options. Elvish and PowerShell load it from `pdfs completions SHELL`, and so does a source
|
||||
build; the [command-line reference](CLI.md#shell-completion) has the line for each shell.
|
||||
`pdfs share` and `pdfs share-role` now check the role (`viewer`, `editor` or `admin`) before
|
||||
sending the request, and `pdfs public-link` does the same for `viewer` and `editor`.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **My files comes back after the service was killed for hanging** (B279). A killed service left
|
||||
|
||||
Reference in new issue
Block a user