cmds.posix.CmdCopy: Add --parents
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m54s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m0s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m50s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m42s
CI / Packaging test (push) Successful in 0s

copy() can now land a single object at its source path, but the copy
CLI command exposes no way to ask for it.

Add a --parents flag forwarded to copy()'s parents argument.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.1.0
This commit is contained in:
Jan Lindemann 2026-10-03 21:39:31 +02:00
commit e5656d7d18
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
2 changed files with 10 additions and 1 deletions

View file

@ -33,6 +33,11 @@ class CmdCopy(Cmd): # export
action = 'store_true',
help = 'Copy directories recursively',
)
parser.add_argument(
'--parents',
action = 'store_true',
help = 'Land a single object at its source path below the destination root',
)
parser.add_argument(
'-F',
'--fixed-strings',
@ -61,4 +66,5 @@ class CmdCopy(Cmd): # export
# -- A mode is given as a string, if at all
mode = int(args.mode, 0) if args.mode is not None else None,
recursive = args.recursive,
parents = args.parents,
)

View file

@ -186,7 +186,8 @@ Available subcommands of posix:
copy Copy files
tar Handle tar archives
============= Running: jw-pkg.py -t ../../../.. --log-level info posix copy --help
usage: jw-pkg.py posix copy [-h] [-o OWNER] [-g GROUP] [-m MODE] [-r] [-F]
usage: jw-pkg.py posix copy [-h] [-o OWNER] [-g GROUP] [-m MODE] [-r]
[--parents] [-F]
src dst
Copy files
@ -201,6 +202,8 @@ options:
-g, --group GROUP Destination file group (default: None)
-m, --mode MODE Destination file mode (default: None)
-r, --recursive Copy directories recursively (default: False)
--parents Land a single object at its source path below the
destination root (default: False)
-F, --fixed-strings Don't expand macros in <src> and <dst> (default: False)
============= Running: jw-pkg.py -t ../../../.. --log-level info posix tar --help
usage: jw-pkg.py posix tar [-h] ...