aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-03-03 10:22:20 -0600
committerRob Landley <rob@landley.net>2020-03-03 10:22:20 -0600
commit16c0ba51db1c1cddb9cda83e3c88fd69ca1f3e5f (patch)
treea22e702bdf0c681ba56dca3ca9c8c30b477eff25 /toys
parent2598f40a611e61191cef6e9e81de8906458dd893 (diff)
downloadtoybox-16c0ba51db1c1cddb9cda83e3c88fd69ca1f3e5f.tar.gz
Remove another command sub-option.
The question "how does this toybox command behave" should have an answer, not "it depends". (Also, --preserve at the start of a paragraph was confusing config2help.c into thinking it was an option paragraph.)
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/cp.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index 13bfd7ef..f70c0501 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -15,7 +15,7 @@
// options shared between mv/cp must be in same order (right to left)
// for FLAG macros to work out right in shared infrastructure.
-USE_CP(NEWTOY(cp, "<2"USE_CP_PRESERVE("(preserve):;")"D(parents)RHLPprdaslvnF(remove-destination)fiT[-HLPd][-ni]", TOYFLAG_BIN))
+USE_CP(NEWTOY(cp, "<2(preserve):;D(parents)RHLPprdaslvnF(remove-destination)fiT[-HLPd][-ni]", TOYFLAG_BIN))
USE_MV(NEWTOY(mv, "<2vnF(remove-destination)fiT[-ni]", TOYFLAG_BIN))
USE_INSTALL(NEWTOY(install, "<1cdDpsvm:o:g:", TOYFLAG_USR|TOYFLAG_BIN))
@@ -23,7 +23,7 @@ config CP
bool "cp"
default y
help
- usage: cp [-adfHiLlnPpRrsTv] SOURCE... DEST
+ usage: cp [-adfHiLlnPpRrsTv] [--preserve=motcxa] SOURCE... DEST
Copy files from SOURCE to DEST. If more than one SOURCE, DEST must
be a directory.
@@ -46,15 +46,7 @@ config CP
-T DEST always treated as file, max 2 arguments
-v Verbose
-config CP_PRESERVE
- bool "cp --preserve support"
- default y
- depends on CP
- help
- usage: cp [--preserve=motcxa]
-
- --preserve takes either a comma separated list of attributes, or the first
- letter(s) of:
+ Arguments to --preserve are the first letter(s) of:
mode - permissions (ignore umask for rwx, copy suid and sticky bit)
ownership - user and group
@@ -381,7 +373,7 @@ void cp_main(void)
if (FLAG(a)||FLAG(p)) TT.pflags = _CP_mode|_CP_ownership|_CP_timestamps;
// Not using comma_args() (yet?) because interpeting as letters.
- if (CFG_CP_PRESERVE && FLAG(preserve)) {
+ if (FLAG(preserve)) {
char *pre = xstrdup(TT.c.preserve ? TT.c.preserve : "mot"), *s;
if (comma_remove(pre, "all")) TT.pflags = ~0;