From 16c0ba51db1c1cddb9cda83e3c88fd69ca1f3e5f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 3 Mar 2020 10:22:20 -0600 Subject: 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.) --- toys/posix/cp.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'toys/posix/cp.c') 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; -- cgit v1.2.3