aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Alex Elsayed <eternaleye@gmail.com> 2011-06-27 18:49:23 -0700
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-06-30 10:27:28 +0100
commit21af4bf5f51e7e146ccd52b7c24f42ab12bea98c (patch)
tree21986cb21724e12d6cf7d40e98ba6d07ce170300
parent24109768eccadd986a80080f8fe5db3ed0fc5b38 (diff)
downloadpaludis-21af4bf5f51e7e146ccd52b7c24f42ab12bea98c.tar.gz
paludis-21af4bf5f51e7e146ccd52b7c24f42ab12bea98c.tar.xz
Switch 'owner' and 'print-owners' cave subcommands from --match to --type
-rw-r--r--src/clients/cave/cmd_owner.cc8
-rw-r--r--src/clients/cave/cmd_print_owners.cc8
-rw-r--r--src/clients/cave/owner_common.cc8
3 files changed, 12 insertions, 12 deletions
diff --git a/src/clients/cave/cmd_owner.cc b/src/clients/cave/cmd_owner.cc
index c6b5239..c8f30f4 100644
--- a/src/clients/cave/cmd_owner.cc
+++ b/src/clients/cave/cmd_owner.cc
@@ -63,12 +63,12 @@ namespace
}
args::ArgsGroup g_owner_options;
- args::EnumArg a_match;
+ args::EnumArg a_type;
args::SwitchArg a_dereference;
OwnerCommandLine() :
g_owner_options(main_options_section(), "Owner options", "Alter how the search is performed."),
- a_match(&g_owner_options, "match", 'm', "Which match algorithm to use",
+ a_type(&g_owner_options, "type", 't', "Which type of match algorithm to use",
args::EnumArg::EnumArgOptions
("auto", 'a', "If pattern starts with a /, full; if it contains a /, partial; otherwise, basename")
("basename", 'b', "Basename match")
@@ -78,7 +78,7 @@ namespace
a_dereference(&g_owner_options, "dereference", 'd', "If the pattern is a path that exists and is a symbolic link, "
"dereference it recursively, and then search for the real path.", true)
{
- add_usage_line("[ --match algorithm ] pattern");
+ add_usage_line("[ --type algorithm ] pattern");
}
};
@@ -106,7 +106,7 @@ OwnerCommand::run(
if (std::distance(cmdline.begin_parameters(), cmdline.end_parameters()) != 1)
throw args::DoHelp("owner takes exactly one parameter");
- return owner_common(env, cmdline.a_match.argument(), *cmdline.begin_parameters(),
+ return owner_common(env, cmdline.a_type.argument(), *cmdline.begin_parameters(),
cmdline.a_dereference.specified(), &format_id);
}
diff --git a/src/clients/cave/cmd_print_owners.cc b/src/clients/cave/cmd_print_owners.cc
index 6a89ac0..c7636c5 100644
--- a/src/clients/cave/cmd_print_owners.cc
+++ b/src/clients/cave/cmd_print_owners.cc
@@ -52,11 +52,11 @@ namespace
}
args::ArgsGroup g_owner_options;
- args::EnumArg a_match;
+ args::EnumArg a_type;
PrintOwnersCommandLine() :
g_owner_options(main_options_section(), "Owner options", "Alter how the search is performed."),
- a_match(&g_owner_options, "match", 'm', "Which match algorithm to use",
+ a_type(&g_owner_options, "type", 't', "Which type of match algorithm to use",
args::EnumArg::EnumArgOptions
("auto", "If pattern starts with a /, full; if it contains a /, partial; otherwise, basename")
("basename", "Basename match")
@@ -64,7 +64,7 @@ namespace
("partial", "Partial match"),
"auto")
{
- add_usage_line("[ --match algorithm ] pattern");
+ add_usage_line("[ --type algorithm ] pattern");
}
};
@@ -92,7 +92,7 @@ PrintOwnersCommand::run(
if (std::distance(cmdline.begin_parameters(), cmdline.end_parameters()) != 1)
throw args::DoHelp("print-owners takes exactly one parameter");
- return owner_common(env, cmdline.a_match.argument(), *cmdline.begin_parameters(), false, &print_package_id);
+ return owner_common(env, cmdline.a_type.argument(), *cmdline.begin_parameters(), false, &print_package_id);
}
std::shared_ptr<args::ArgsHandler>
diff --git a/src/clients/cave/owner_common.cc b/src/clients/cave/owner_common.cc
index 5b7a205..7032174 100644
--- a/src/clients/cave/owner_common.cc
+++ b/src/clients/cave/owner_common.cc
@@ -60,7 +60,7 @@ namespace
int
paludis::cave::owner_common(
const std::shared_ptr<Environment> & env,
- const std::string & match,
+ const std::string & type,
const std::string & q,
const bool dereference,
const std::function<void (const std::shared_ptr<const PackageID> &)> & callback)
@@ -83,11 +83,11 @@ paludis::cave::owner_common(
if (query.length() >= 2 && '/' == query.at(query.length() - 1))
query.erase(query.length() - 1);
- if ("full" == match)
+ if ("full" == type)
handler = handle_full;
- else if ("basename" == match)
+ else if ("basename" == type)
handler = handle_basename;
- else if ("partial" == match)
+ else if ("partial" == type)
handler = handle_partial;
else
{