|
|
88751e |
#include "tpax_driver_impl.h"
|
|
|
538329 |
#include "tpax_visibility_impl.h"
|
|
|
88751e |
#include "argv/argv.h"
|
|
|
88751e |
|
|
|
538329 |
const tpax_hidden struct argv_option tpax_default_options[] = {
|
|
|
e4338c |
{"Wversion", 0,TAG_VERSION,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
88751e |
"show version information"},
|
|
|
88751e |
|
|
|
e4338c |
{"Whelp", 0,TAG_HELP,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
e4338c |
"show usage information"},
|
|
|
88751e |
|
|
|
e4338c |
{"Wlist", 0,TAG_LIST,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
fb301b |
"list mode (output names of archive members)"},
|
|
|
893ea2 |
|
|
|
e4338c |
{"Wread", 'r',TAG_READ,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
fb301b |
"read mode (extract matching archive members)"},
|
|
|
893ea2 |
|
|
|
e4338c |
{"Write", 'w',TAG_WRITE,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
fb301b |
"write mode (add specified files to archive)"},
|
|
|
893ea2 |
|
|
|
e4338c |
{"Wcopy", 0,TAG_COPY,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
893ea2 |
"copy mode (copy specified files "
|
|
|
893ea2 |
"to a specified destination directory)"},
|
|
|
893ea2 |
|
|
|
156e23 |
{"Wfile", 'f',TAG_FILE,ARGV_OPTARG_REQUIRED,
|
|
|
156e23 |
ARGV_OPTION_HYBRID_ONLY|ARGV_OPTION_HYBRID_EQUAL,
|
|
|
156e23 |
0,"<ARCHIVE>",
|
|
|
156e23 |
"read from (in read or list modes), "
|
|
|
156e23 |
"or write to (in write mode) the specified %s "
|
|
|
156e23 |
"after (in write mode) creating it as necessary"},
|
|
|
8aa3fc |
|
|
|
e4338c |
{"Wformat", 'x',TAG_FORMAT,ARGV_OPTARG_REQUIRED,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY|ARGV_OPTION_HYBRID_EQUAL,
|
|
|
8aa3fc |
"pax|cpio|ustar|rustar",0,
|
|
|
8aa3fc |
"archive format [%s]"},
|
|
|
8aa3fc |
|
|
|
e99de3 |
{"Wverbose", 'v',TAG_VERBOSE,ARGV_OPTARG_NONE,
|
|
|
e99de3 |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
e99de3 |
"write pathnames to stderr in read, write, and copy modes; "
|
|
|
e99de3 |
"produce verbose output in list mode."},
|
|
|
e99de3 |
|
|
|
e4338c |
{"Wblksize", 'b',TAG_BLKSIZE,ARGV_OPTARG_REQUIRED,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY|ARGV_OPTION_HYBRID_EQUAL,0,0,
|
|
|
54c29f |
"(non-default) block-size; valid values are "
|
|
|
54c29f |
"in the range of 512 to 32256; keeping "
|
|
|
54c29f |
"the default format-specific block size "
|
|
|
54c29f |
"(5120 for the pax and cpio formats,"
|
|
|
54c29f |
" 10240 for the ustar format) "
|
|
|
54c29f |
"is strongly recommended."},
|
|
|
54c29f |
|
|
|
e4338c |
{"Wrecurse", 0,TAG_RECURSE,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
23fa88 |
"recurse into directory archive members "
|
|
|
23fa88 |
"(this is the tpax_main() default)"},
|
|
|
23fa88 |
|
|
|
e4338c |
{"Wno-recurse",'d',TAG_NORECURSE,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
23fa88 |
"do not recurse into directory archive members"},
|
|
|
23fa88 |
|
|
|
ee80f8 |
{"Wpreserve-atime",
|
|
|
ee80f8 |
't',TAG_PRESERVE_ATIME,ARGV_OPTARG_NONE,
|
|
|
ee80f8 |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
ee80f8 |
"when user has the necessary permissions, "
|
|
|
ee80f8 |
"set the access time of each file to the access "
|
|
|
ee80f8 |
"time that was reported by fstatat(3) prior to the "
|
|
|
ee80f8 |
"first read operation performed by pax"},
|
|
|
ee80f8 |
|
|
|
37f513 |
{"Wpax-symlink-args",
|
|
|
37f513 |
'H',TAG_PAX_SYMLINK_ARGS,ARGV_OPTARG_NONE,
|
|
|
37f513 |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
37f513 |
"when a command-line argument is a symbolic link, "
|
|
|
37f513 |
"add the underlying (referenced) file-system object "
|
|
|
37f513 |
"or directory to the archive using the name of the "
|
|
|
37f513 |
"symbolic link."},
|
|
|
37f513 |
|
|
|
e50240 |
{"Wpax-symlink-items",
|
|
|
e50240 |
'L',TAG_PAX_SYMLINK_ITEMS,ARGV_OPTARG_NONE,
|
|
|
e50240 |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
e50240 |
"when a command-line argument is a symbolic link, or when "
|
|
|
e50240 |
"an item added by way of recursion is a symbolic link, "
|
|
|
e50240 |
"add the underlying (referenced) file-system object "
|
|
|
e50240 |
"or directory to the archive using the name of the "
|
|
|
e50240 |
"symbolic link."},
|
|
|
e50240 |
|
|
|
722538 |
{"Woptions", 'o',TAG_OPTIONS,ARGV_OPTARG_REQUIRED,
|
|
|
722538 |
ARGV_OPTION_HYBRID_ONLY|ARGV_OPTION_HYBRID_SPACE|ARGV_OPTION_KEYVAL_ARRAY,0,0,
|
|
|
722538 |
"a user-provided, format-specific keyval array of the form "
|
|
|
722538 |
"keyword[[:]=value][,keyword[[:]=value], ...]"},
|
|
|
722538 |
|
|
|
5ea1d7 |
{"Wreplstr", 's',TAG_REPLSTR,ARGV_OPTARG_REQUIRED,
|
|
|
5ea1d7 |
ARGV_OPTION_HYBRID_ONLY|ARGV_OPTION_HYBRID_SPACE,0,0,
|
|
|
5ea1d7 |
"rename files and archive members as they are being added to "
|
|
|
5ea1d7 |
"or extracted from the archive according to the specified "
|
|
|
5ea1d7 |
"ed(1) style replacement string, which should be in the format "
|
|
|
5ea1d7 |
"<sep><regex><sep><replstr><sep>[gp]; as an example, "
|
|
|
5ea1d7 |
"-s ',^/git/tpax/,tpax-1.2.3/,' uses <comma> as the separator "
|
|
|
5ea1d7 |
"character, and instructs pax to prefix all files rooted in "
|
|
|
5ea1d7 |
"'/git/tpax/' with 'tpax-1.2.3/' while leaving the names of files which "
|
|
|
5ea1d7 |
"do not match the regex expression unchanged. "
|
|
|
5ea1d7 |
"When this option is repeated, pax shall attempt to match each file or "
|
|
|
5ea1d7 |
"member name against all of the provided repalcement-string arguments "
|
|
|
5ea1d7 |
"in the order of appearnce on the command line until the first "
|
|
|
5ea1d7 |
"successful match."},
|
|
|
5ea1d7 |
|
|
|
4275a9 |
{"Wstrict-device-id",
|
|
|
4275a9 |
'X',TAG_STRICT_DEVICE_ID,ARGV_OPTARG_NONE,
|
|
|
4275a9 |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
4275a9 |
"do not recurse into directories across device boundaries"},
|
|
|
4275a9 |
|
|
|
e4338c |
{"Wstrict-path-input",
|
|
|
e4338c |
0,TAG_STRICT_PATH,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
efbaf8 |
"do not allow file arguments (in write and copy modes) "
|
|
|
efbaf8 |
"to contain parent-directoy (dot dot) references"},
|
|
|
efbaf8 |
|
|
|
e4338c |
{"Wpure-path-output",
|
|
|
e4338c |
0,TAG_PURE_PATH,ARGV_OPTARG_NONE,
|
|
|
e4338c |
ARGV_OPTION_HYBRID_ONLY,0,0,
|
|
|
efbaf8 |
"output (in list mode) or store (in write mode) path "
|
|
|
efbaf8 |
"names in pure form, specifically by liminating all "
|
|
|
efbaf8 |
"this-dir (dot) elements from the listed/stored path "
|
|
|
efbaf8 |
"name, as well as replacing each meaningless sequence "
|
|
|
efbaf8 |
"of consecutive forward slash characters with a single "
|
|
|
efbaf8 |
"forward slash; the presence of exactly two forward "
|
|
|
efbaf8 |
"slash characters in the beginning of a path may be "
|
|
|
efbaf8 |
"meaningful, and therefore shall remain instact."},
|
|
|
efbaf8 |
|
|
|
88751e |
{0,0,0,0,0,0,0,0}
|
|
|
88751e |
};
|