aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2007-01-25 00:12:50 +0000
committerAvatar Mike Kelly <pioto@pioto.org> 2007-01-25 00:12:50 +0000
commit2c67a1b0308b2c0bd4685ec32781ba34da4877d6 (patch)
treed498bfcb26b85558d91b53211cb0414e998c4a7a
parentef5f55422692648ab93bbf03b5b1d40b4a4b17aa (diff)
downloadpaludis-2c67a1b0308b2c0bd4685ec32781ba34da4877d6.tar.gz
paludis-2c67a1b0308b2c0bd4685ec32781ba34da4877d6.tar.xz
Add a --repository-format option to allow restricting --list-* output to just repositories with a matching format.
-rw-r--r--bash-completion/paludis5
-rw-r--r--src/clients/paludis/command_line.cc1
-rw-r--r--src/clients/paludis/command_line.hh3
-rw-r--r--src/clients/paludis/list.cc24
4 files changed, 33 insertions, 0 deletions
diff --git a/bash-completion/paludis b/bash-completion/paludis
index 1907e17..c2e4c23 100644
--- a/bash-completion/paludis
+++ b/bash-completion/paludis
@@ -111,6 +111,7 @@ _paludis() {
env_variable_query_opts=""
conf_variable_query_opts=""
list_opts="--repository \
+ --repository-format \
--category \
--package \
--set"
@@ -257,6 +258,10 @@ _paludis() {
COMPREPLY=($(compgen -W "$(_paludis_dolist repositories)" -- "${cur}"))
return 0
;;
+ --repository-format)
+ COMPREPLY=($(compgen -W "$(_paludis_dolist repository-formats)" -- "${cur}"))
+ return 0
+ ;;
--category)
COMPREPLY=($(compgen -W "$(_paludis_dolist categories)" -- "${cur}"))
return 0
diff --git a/src/clients/paludis/command_line.cc b/src/clients/paludis/command_line.cc
index 0284a0a..670ec9c 100644
--- a/src/clients/paludis/command_line.cc
+++ b/src/clients/paludis/command_line.cc
@@ -203,6 +203,7 @@ CommandLine::CommandLine() :
list_args(this, "List options",
"Options relevant for one or more of the --list actions."),
a_repository(&list_args, "repository", '\0', "Matches with this repository name only"),
+ a_repository_format(&list_args, "repository-format", '\0', "Matches with this repository format only"),
a_category(&list_args, "category", '\0', "Matches with this category name only"),
a_package(&list_args, "package", '\0', "Matches with this package name only"),
a_set(&list_args, "set", '\0', "Matches with this package set name only"),
diff --git a/src/clients/paludis/command_line.hh b/src/clients/paludis/command_line.hh
index cd5e92e..59466fd 100644
--- a/src/clients/paludis/command_line.hh
+++ b/src/clients/paludis/command_line.hh
@@ -271,6 +271,9 @@ class CommandLine :
/// --repository
paludis::args::StringSetArg a_repository;
+ /// --repository-format
+ paludis::args::StringSetArg a_repository_format;
+
/// --category
paludis::args::StringSetArg a_category;
diff --git a/src/clients/paludis/list.cc b/src/clients/paludis/list.cc
index 7811748..372b212 100644
--- a/src/clients/paludis/list.cc
+++ b/src/clients/paludis/list.cc
@@ -49,6 +49,12 @@ do_list_repositories()
CommandLine::get_instance()->a_repository.end_args(),
stringify(r->name())))
continue;
+ if (CommandLine::get_instance()->a_repository_format.specified())
+ if (CommandLine::get_instance()->a_repository_format.end_args() == std::find(
+ CommandLine::get_instance()->a_repository_format.begin_args(),
+ CommandLine::get_instance()->a_repository_format.end_args(),
+ r->format()))
+ continue;
ret_code = 0;
@@ -90,6 +96,12 @@ do_list_categories()
CommandLine::get_instance()->a_repository.end_args(),
stringify(r->name())))
continue;
+ if (CommandLine::get_instance()->a_repository_format.specified())
+ if (CommandLine::get_instance()->a_repository_format.end_args() == std::find(
+ CommandLine::get_instance()->a_repository_format.begin_args(),
+ CommandLine::get_instance()->a_repository_format.end_args(),
+ r->format()))
+ continue;
p::CategoryNamePartCollection::ConstPointer cat_names(r->category_names());
for (p::CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
@@ -138,6 +150,12 @@ do_list_packages()
CommandLine::get_instance()->a_repository.end_args(),
stringify(r->name())))
continue;
+ if (CommandLine::get_instance()->a_repository_format.specified())
+ if (CommandLine::get_instance()->a_repository_format.end_args() == std::find(
+ CommandLine::get_instance()->a_repository_format.begin_args(),
+ CommandLine::get_instance()->a_repository_format.end_args(),
+ r->format()))
+ continue;
p::CategoryNamePartCollection::ConstPointer cat_names(r->category_names());
for (p::CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
@@ -201,6 +219,12 @@ do_list_sets()
CommandLine::get_instance()->a_repository.end_args(),
stringify(r->name())))
continue;
+ if (CommandLine::get_instance()->a_repository_format.specified())
+ if (CommandLine::get_instance()->a_repository_format.end_args() == std::find(
+ CommandLine::get_instance()->a_repository_format.begin_args(),
+ CommandLine::get_instance()->a_repository_format.end_args(),
+ r->format()))
+ continue;
p::SetsCollection::ConstPointer set_names(r->sets_interface->sets_list());
for (p::SetsCollection::Iterator s(set_names->begin()), s_end(set_names->end()) ;