eupak: Rename "info" command to "list"

It makes slightly more sense, especially given the file listing is
always printed. So let's do that.
This commit is contained in:
Lily Tsuru 2025-01-21 17:49:23 -05:00
parent 94fda4e349
commit f8e9034ac7
3 changed files with 10 additions and 10 deletions

View file

@ -12,7 +12,7 @@ add_executable(eupak
# eupak commands # eupak commands
CreateCommand.cpp CreateCommand.cpp
InfoCommand.cpp ListCommand.cpp
ExtractCommand.cpp ExtractCommand.cpp
) )

View file

@ -20,12 +20,12 @@ namespace eupak {
constexpr static auto DATE_FORMAT = "%m/%d/%Y %r"; constexpr static auto DATE_FORMAT = "%m/%d/%Y %r";
struct InfoCommand : tool::IToolCommand { struct ListCommand : tool::IToolCommand {
InfoCommand() ListCommand()
: parser("info", EUPAK_VERSION_STR, argparse::default_arguments::help) { : parser("list", EUPAK_VERSION_STR, argparse::default_arguments::help) {
// clang-format off // clang-format off
parser parser
.add_description("Print information about a package file."); .add_description("Lists package file information and files.");
parser parser
.add_argument("input") .add_argument("input")
.help("Input archive") .help("Input archive")
@ -34,8 +34,8 @@ namespace eupak {
// FIXME: Probably just print this always, in a thinner format, but use // FIXME: Probably just print this always, in a thinner format, but use
// the existing thicker format for verbosity. // the existing thicker format for verbosity.
parser parser
.add_argument("--verbose") .add_argument("-v", "--verbose")
.help("Increase information output verbosity (print a list of files).") .help("Increase information output verbosity.")
.default_value(false) .default_value(false)
.implicit_value(true); .implicit_value(true);
// clang-format on // clang-format on
@ -46,7 +46,7 @@ namespace eupak {
} }
bool ShouldRun(argparse::ArgumentParser& parentParser) const override { bool ShouldRun(argparse::ArgumentParser& parentParser) const override {
return parentParser.is_subcommand_used("info"); return parentParser.is_subcommand_used("list");
} }
int Parse() override { int Parse() override {
@ -130,6 +130,6 @@ namespace eupak {
Arguments currentArgs; Arguments currentArgs;
}; };
TOOLLIB_REGISTER_TOOLCOMMAND("eupak_info", InfoCommand); TOOLLIB_REGISTER_TOOLCOMMAND("eupak_list", ListCommand);
} // namespace eupak } // namespace eupak

View file

@ -20,7 +20,7 @@ int main(int argc, char** argv) {
auto toolCommands = std::vector { auto toolCommands = std::vector {
tool::ToolCommandFactory::CreateNamed("eupak_create"), tool::ToolCommandFactory::CreateNamed("eupak_create"),
tool::ToolCommandFactory::CreateNamed("eupak_extract"), tool::ToolCommandFactory::CreateNamed("eupak_extract"),
tool::ToolCommandFactory::CreateNamed("eupak_info"), tool::ToolCommandFactory::CreateNamed("eupak_list"),
}; };
// clang-format off // clang-format off