DolphinTool: Kill an unnecessary unique_ptr.

This commit is contained in:
Jordan Woyak 2022-03-08 01:57:08 -06:00
parent 58c02e6b85
commit f711b8dbae
1 changed files with 11 additions and 11 deletions

View File

@ -10,57 +10,57 @@ namespace DolphinTool
{ {
int ConvertCommand::Main(const std::vector<std::string>& args) int ConvertCommand::Main(const std::vector<std::string>& args)
{ {
auto parser = std::make_unique<optparse::OptionParser>(); optparse::OptionParser parser;
parser->usage("usage: convert [options]... [FILE]..."); parser.usage("usage: convert [options]... [FILE]...");
parser->add_option("-u", "--user") parser.add_option("-u", "--user")
.action("store") .action("store")
.help("User folder path, required for temporary processing files." .help("User folder path, required for temporary processing files."
"Will be automatically created if this option is not set."); "Will be automatically created if this option is not set.");
parser->add_option("-i", "--input") parser.add_option("-i", "--input")
.type("string") .type("string")
.action("store") .action("store")
.help("Path to disc image FILE.") .help("Path to disc image FILE.")
.metavar("FILE"); .metavar("FILE");
parser->add_option("-o", "--output") parser.add_option("-o", "--output")
.type("string") .type("string")
.action("store") .action("store")
.help("Path to the destination FILE.") .help("Path to the destination FILE.")
.metavar("FILE"); .metavar("FILE");
parser->add_option("-f", "--format") parser.add_option("-f", "--format")
.type("string") .type("string")
.action("store") .action("store")
.help("Container format to use. Default is RVZ. [%choices]") .help("Container format to use. Default is RVZ. [%choices]")
.choices({"iso", "gcz", "wia", "rvz"}); .choices({"iso", "gcz", "wia", "rvz"});
parser->add_option("-s", "--scrub") parser.add_option("-s", "--scrub")
.action("store_true") .action("store_true")
.help("Scrub junk data as part of conversion."); .help("Scrub junk data as part of conversion.");
parser->add_option("-b", "--block_size") parser.add_option("-b", "--block_size")
.type("int") .type("int")
.action("store") .action("store")
.help("Block size for GCZ/WIA/RVZ formats, as an integer. Suggested value for RVZ: 131072 " .help("Block size for GCZ/WIA/RVZ formats, as an integer. Suggested value for RVZ: 131072 "
"(128 KiB)"); "(128 KiB)");
parser->add_option("-c", "--compression") parser.add_option("-c", "--compression")
.type("string") .type("string")
.action("store") .action("store")
.help("Compression method to use when converting to WIA/RVZ. Suggested value for RVZ: zstd " .help("Compression method to use when converting to WIA/RVZ. Suggested value for RVZ: zstd "
"[%choices]") "[%choices]")
.choices({"none", "zstd", "bzip", "lzma", "lzma2"}); .choices({"none", "zstd", "bzip", "lzma", "lzma2"});
parser->add_option("-l", "--compression_level") parser.add_option("-l", "--compression_level")
.type("int") .type("int")
.action("store") .action("store")
.help("Level of compression for the selected method. Ignored if 'none'. Suggested value for " .help("Level of compression for the selected method. Ignored if 'none'. Suggested value for "
"zstd: 5"); "zstd: 5");
const optparse::Values& options = parser->parse_args(args); const optparse::Values& options = parser.parse_args(args);
// Initialize the dolphin user directory, required for temporary processing files // Initialize the dolphin user directory, required for temporary processing files
// If this is not set, destructive file operations could occur due to path confusion // If this is not set, destructive file operations could occur due to path confusion