#include "filenamecat.h"
#include "quote.h"
#include "quotearg.h"
+#include "stat-time.h"
#include "utimens.h"
#define ASSIGN_BASENAME_STRDUPA(Dest, File_name) \
{
"never", "auto", "always", NULL
};
-
static enum Sparse_type const sparse_type[] =
{
SPARSE_NEVER, SPARSE_AUTO, SPARSE_ALWAYS
};
+ARGMATCH_VERIFY (sparse_type_string, sparse_type);
/* Valid arguments to the `--reply' option. */
static char const* const reply_args[] =
{
"yes", "no", "query", NULL
};
-
/* The values that correspond to the above strings. */
static int const reply_vals[] =
{
I_ALWAYS_YES, I_ALWAYS_NO, I_ASK_USER
};
+ARGMATCH_VERIFY (reply_args, reply_vals);
static struct option const long_opts[] =
{
{"preserve", optional_argument, NULL, PRESERVE_ATTRIBUTES_OPTION},
{"recursive", no_argument, NULL, 'R'},
{"remove-destination", no_argument, NULL, UNLINK_DEST_BEFORE_OPENING},
- {"reply", required_argument, NULL, REPLY_OPTION},
+ {"reply", required_argument, NULL, REPLY_OPTION}, /* Deprecated 2005-07-03,
+ remove in 2008. */
{"sparse", required_argument, NULL, SPARSE_OPTION},
{"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION},
{"suffix", required_argument, NULL, 'S'},
{"target-directory", required_argument, NULL, 't'},
{"update", no_argument, NULL, 'u'},
{"verbose", no_argument, NULL, 'v'},
- {"version-control", required_argument, NULL, 'V'}, /* Deprecated. FIXME. */
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
attempting to open it (contrast with --force)\n\
"), stdout);
fputs (_("\
- --reply={yes,no,query} specify how to handle the prompt about an\n\
- existing destination file\n\
--sparse=WHEN control creation of sparse files\n\
--strip-trailing-slashes remove any trailing slashes from each SOURCE\n\
argument\n\
{
struct timespec timespec[2];
- timespec[0].tv_sec = src_sb.st_atime;
- timespec[0].tv_nsec = TIMESPEC_NS (src_sb.st_atim);
- timespec[1].tv_sec = src_sb.st_mtime;
- timespec[1].tv_nsec = TIMESPEC_NS (src_sb.st_mtim);
+ timespec[0] = get_stat_atime (&src_sb);
+ timespec[1] = get_stat_mtime (&src_sb);
if (utimens (dst_name, timespec))
{
PRESERVE_MODE, PRESERVE_TIMESTAMPS,
PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_ALL
};
-
/* Valid arguments to the `--preserve' option. */
static char const* const preserve_args[] =
{
"mode", "timestamps",
"ownership", "links", "all", NULL
};
+ ARGMATCH_VERIFY (preserve_args, preserve_vals);
char *arg_writable = xstrdup (arg);
char *s = arg_writable;
we'll actually use backup_suffix_string. */
backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
- while ((c = getopt_long (argc, argv, "abdfHilLprst:uvxPRS:TV:",
+ while ((c = getopt_long (argc, argv, "abdfHilLprst:uvxPRS:T",
long_opts, NULL))
!= -1)
{
x.recursive = true;
break;
- case 'V': /* FIXME: this is deprecated. Remove it in 2001. */
- error (0, 0,
- _("warning: --version-control (-V) is obsolete; support for\
- it\nwill be removed in some future release. Use --backup=%s instead."
- ), optarg);
- /* Fall through. */
-
case 'b':
make_backups = true;
if (optarg)
x.recursive = true;
break;
- case REPLY_OPTION:
+ case REPLY_OPTION: /* Deprecated */
x.interactive = XARGMATCH ("--reply", optarg,
reply_args, reply_vals);
+ error (0, 0,
+ _("the --reply option is deprecated; use -i or -f instead"));
break;
case UNLINK_DEST_BEFORE_OPENING: