Fix transfer rough edges: value-name hint, identity warnings, single-profile export

- --help now shows <PATH.toml> instead of the format-agnostic <PATH>.
- Export warns (naming the affected profiles) that identity files
  aren't included, only their local paths; import warns per-profile
  when an identity path doesn't resolve on the importing machine,
  expanding a leading ~/ the same way ssh.rs does so that check isn't
  a false positive for tilde paths.
- transfer now takes an optional profile-name positional (same shape
  as OpenArgs.name) so -e/--export can target a single profile instead
  of always dumping every saved one; combining it with -i/--import is
  rejected with a new TransferNameWithImport error.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-13 23:04:30 +02:00
parent 125d72c918
commit 5ce0614cad
3 changed files with 85 additions and 8 deletions

View File

@@ -188,11 +188,14 @@ pub struct WipeArgs {
#[derive(Args)]
pub struct TransferArgs {
/// Export all saved profiles to a file.
#[arg(short, long, value_name = "PATH")]
/// Name of the profile to export; every saved profile if omitted. Not used for import.
pub name: Option<String>,
/// Export saved profiles to a file.
#[arg(short, long, value_name = "PATH.toml")]
pub export: Option<String>,
/// Import profiles from a file.
#[arg(short, long, value_name = "PATH")]
#[arg(short, long, value_name = "PATH.toml")]
pub import: Option<String>,
}