feat: share clients — picker enhancements, unmount fixes, confirm default-y convention
- mountpoint picker: synthetic (as on server) candidate + n=new mkdir flow - unmount-by-pick via findmnt enumeration with confirm - cmd_unmount idle-persisted branch exit 0 → return 0 + actionable guidance - all menu handlers normalized … || true - confirm() rewrite: default-y on Enter, EOF fail-closed, case-insensitive - latent compose "Y" bug fixed - DEV.md convention doc for confirm semantics
This commit is contained in:
+5
-1
@@ -72,7 +72,7 @@ Sourced by most scripts. Key functions:
|
||||
| `run cmd` | Executes command, respects `$DRY_RUN` |
|
||||
| `spawn "msg" cmd` | Animated braille spinner + elapsed time |
|
||||
| `timer_start` / `timer_stop` | Elapsed time tracking |
|
||||
| `confirm "prompt"` | y/N prompt with optional default |
|
||||
| `confirm "prompt" [default]` | y/n prompt; Enter accepts the default (`y` when omitted) |
|
||||
|
||||
---
|
||||
|
||||
@@ -428,6 +428,10 @@ pos-communication-<platform> send <value> [--markdown] # exit 0 on delivery
|
||||
|
||||
then listing it in `NOTIFY_PLATFORM`. Platform keys map to tool names via `notify_sender_name()` in `lib/notify.sh` — the telegram platform key stays `telegram` but its tool is `pos-communication-telegram-sender`. `pos-communication-telegram-sender` already follows this (`--markdown` is an alias for `--parse-mode markdown`). No changes to `lib/notify.sh` are needed for a new platform.
|
||||
|
||||
### Confirmation prompts
|
||||
|
||||
`confirm()` rule: Enter accepts the displayed default; destructive call sites pass explicit `'n'`.
|
||||
|
||||
### Idempotency
|
||||
|
||||
Check before creating, use `>>` with grep guards, don't overwrite user configs.
|
||||
|
||||
+15
-3
@@ -153,8 +153,14 @@ up — a down/unreachable NFS server can't break boot (with fstab it could).
|
||||
|
||||
**Interactive menu:** run `pos share nfs client` with no args for a menu
|
||||
(mount / persist / unmount / unpersist / list). Mountpoints are offered from
|
||||
existing mount-layout candidates with manual entry as fallback; unmount and
|
||||
unpersist tolerate already-absent targets instead of erroring.
|
||||
existing mount-layout candidates with manual entry as fallback — the picker
|
||||
also accepts the server-side export path as a "(as on server)" pick when it
|
||||
differs from your local layout, and `n=new` creates a fresh directory in
|
||||
place (y/N confirmed; a failure just returns to the picker). Unmount lists
|
||||
the active NFS mounts as `<mountpoint> ← <source>` picks and asks for
|
||||
confirmation before unmounting (with a typed fallback when nothing is
|
||||
mounted); unmount and unpersist tolerate already-absent targets instead of
|
||||
erroring.
|
||||
|
||||
**Troubleshooting:**
|
||||
- "mount.nfs not found" → `nfs-common` isn't installed; `sudo apt install nfs-common`
|
||||
@@ -285,7 +291,13 @@ fstab it could). `enable --now` arms the automount immediately.
|
||||
(enumerate / mount / persist / unmount / unpersist / list). Enter the server,
|
||||
an empty user tries guest enumeration first (with an auth retry on denial),
|
||||
then shares and mountpoints are offered as pickers with manual fallback —
|
||||
the account you authenticated with is reused for the mount.
|
||||
the account you authenticated with is reused for the mount. The mountpoint
|
||||
picker accepts `n=new` to create a fresh directory in place (y/N confirmed;
|
||||
a failure just returns to the picker); when the server is this machine, its
|
||||
underlying share directory is offered as a "(as on server)" pick too.
|
||||
Unmount lists the active CIFS mounts as `<mountpoint> ← <source>` picks and
|
||||
asks for confirmation before unmounting (typed fallback when nothing is
|
||||
mounted).
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user