mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-14 06:48:39 -04:00
Simplify mkdwarfs options and make more predictable
This commit is contained in:
parent
cda25a0d84
commit
fb4a236be7
@ -334,7 +334,7 @@ int mkdwarfs(int argc, char** argv) {
|
|||||||
schema_compression, metadata_compression, log_level_str, timestamp,
|
schema_compression, metadata_compression, log_level_str, timestamp,
|
||||||
time_resolution, order, progress_mode, recompress_opts, pack_metadata;
|
time_resolution, order, progress_mode, recompress_opts, pack_metadata;
|
||||||
size_t num_workers;
|
size_t num_workers;
|
||||||
bool no_progress = false, plain_string_tables = false, remove_header = false;
|
bool no_progress = false, remove_header = false;
|
||||||
unsigned level;
|
unsigned level;
|
||||||
uint16_t uid, gid;
|
uint16_t uid, gid;
|
||||||
|
|
||||||
@ -393,14 +393,10 @@ int mkdwarfs(int argc, char** argv) {
|
|||||||
po::value<std::string>(&metadata_compression),
|
po::value<std::string>(&metadata_compression),
|
||||||
"metadata compression algorithm")
|
"metadata compression algorithm")
|
||||||
("pack-metadata,P",
|
("pack-metadata,P",
|
||||||
po::value<std::string>(&pack_metadata)->default_value("all"),
|
po::value<std::string>(&pack_metadata)->default_value("auto"),
|
||||||
"pack certain metadata elements (all, none, mmap, chunk_table, "
|
"pack certain metadata elements (auto, all, none, chunk_table, "
|
||||||
"directories, shared_files, names, names_index, symlinks, "
|
"directories, shared_files, names, names_index, symlinks, "
|
||||||
"symlinks_index)")
|
"symlinks_index, force, plain)")
|
||||||
("plain-string-tables",
|
|
||||||
po::value<bool>(&plain_string_tables)->zero_tokens(),
|
|
||||||
"use plain string tables in metadata (overrides string table "
|
|
||||||
"packing options)")
|
|
||||||
("recompress",
|
("recompress",
|
||||||
po::value<std::string>(&recompress_opts)->implicit_value("all"),
|
po::value<std::string>(&recompress_opts)->implicit_value("all"),
|
||||||
"recompress an existing filesystem (none, block, metadata, all)")
|
"recompress an existing filesystem (none, block, metadata, all)")
|
||||||
@ -741,19 +737,9 @@ int mkdwarfs(int argc, char** argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
options.plain_names_table = plain_string_tables;
|
|
||||||
options.plain_symlinks_table = plain_string_tables;
|
|
||||||
|
|
||||||
if (!pack_metadata.empty() and pack_metadata != "none") {
|
if (!pack_metadata.empty() and pack_metadata != "none") {
|
||||||
if (pack_metadata == "all") {
|
if (pack_metadata == "auto") {
|
||||||
options.pack_chunk_table = true;
|
options.force_pack_string_tables = false;
|
||||||
options.pack_directories = true;
|
|
||||||
options.pack_shared_files_table = true;
|
|
||||||
options.pack_names = true;
|
|
||||||
options.pack_names_index = true;
|
|
||||||
options.pack_symlinks = true;
|
|
||||||
options.pack_symlinks_index = true;
|
|
||||||
} else if (pack_metadata == "mmap") {
|
|
||||||
options.pack_chunk_table = false;
|
options.pack_chunk_table = false;
|
||||||
options.pack_directories = false;
|
options.pack_directories = false;
|
||||||
options.pack_shared_files_table = false;
|
options.pack_shared_files_table = false;
|
||||||
@ -779,6 +765,19 @@ int mkdwarfs(int argc, char** argv) {
|
|||||||
options.pack_symlinks = true;
|
options.pack_symlinks = true;
|
||||||
} else if (opt == "symlinks_index") {
|
} else if (opt == "symlinks_index") {
|
||||||
options.pack_symlinks_index = true;
|
options.pack_symlinks_index = true;
|
||||||
|
} else if (opt == "force") {
|
||||||
|
options.force_pack_string_tables = true;
|
||||||
|
} else if (opt == "plain") {
|
||||||
|
options.plain_names_table = true;
|
||||||
|
options.plain_symlinks_table = true;
|
||||||
|
} else if (opt == "all") {
|
||||||
|
options.pack_chunk_table = true;
|
||||||
|
options.pack_directories = true;
|
||||||
|
options.pack_shared_files_table = true;
|
||||||
|
options.pack_names = true;
|
||||||
|
options.pack_names_index = true;
|
||||||
|
options.pack_symlinks = true;
|
||||||
|
options.pack_symlinks_index = true;
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "error: the argument ('" << opt
|
std::cerr << "error: the argument ('" << opt
|
||||||
<< "') to '--pack-metadata' is invalid" << std::endl;
|
<< "') to '--pack-metadata' is invalid" << std::endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user