aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-24 14:13:58 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-24 14:13:58 +0000
commitf82eb6d18d47389660e8d5da9eb8d1a1bbd7503c (patch)
tree75dcf1cf4340c59a59545a733fbbf290f8708d6c
parentdf502f2988a1810dd1bf770bc07fc46cae037306 (diff)
downloadpaludis-f82eb6d18d47389660e8d5da9eb8d1a1bbd7503c.tar.gz
paludis-f82eb6d18d47389660e8d5da9eb8d1a1bbd7503c.tar.xz
Add mkt_author. Add paludis, inquisitio --show-authors.
-rw-r--r--NEWS2
-rw-r--r--doc/api/cplusplus/examples/example_metadata_key.cc4
-rw-r--r--paludis/metadata_key.se1
-rw-r--r--src/clients/inquisitio/command_line.cc1
-rw-r--r--src/clients/inquisitio/command_line.hh1
-rw-r--r--src/clients/inquisitio/query_task.cc6
-rw-r--r--src/clients/inquisitio/query_task.hh1
-rw-r--r--src/clients/paludis/command_line.cc1
-rw-r--r--src/clients/paludis/command_line.hh3
-rw-r--r--src/clients/paludis/query.cc5
-rw-r--r--src/output/console_query_task.cc6
-rw-r--r--src/output/console_query_task.hh1
12 files changed, 30 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 6b033e3..178424b 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ of every change, see the ChangeLog.
trunk/:
* Various switches now support --no-, for negation.
+ * paludis, inquisitio --show-authors.
+
0.26.0_alpha4:
* STILL BROKEN, wait for 0.26.0 if you use these: CRAN, Ruby bindings for
dep specs.
diff --git a/doc/api/cplusplus/examples/example_metadata_key.cc b/doc/api/cplusplus/examples/example_metadata_key.cc
index 3a037d7..c4b9662 100644
--- a/doc/api/cplusplus/examples/example_metadata_key.cc
+++ b/doc/api/cplusplus/examples/example_metadata_key.cc
@@ -215,8 +215,8 @@ namespace
* the key should be displayed when outputting the package (for
* example, 'paludis --query' shows mkt_significant keys first,
* then mkt_normal keys, and doesn't show mkt_dependencies
- * without '--show-deps' or mkt_internal without
- * '--show-metadata'. */
+ * without '--show-deps', mkt_author without '--show-author'
+ * or mkt_internal without '--show-metadata'. */
cout << indent << left << setw(30) << " Raw name:" << " " << key.raw_name() << endl;
cout << indent << left << setw(30) << " Human name:" << " " << key.human_name() << endl;
cout << indent << left << setw(30) << " Type:" << " " << key.type() << endl;
diff --git a/paludis/metadata_key.se b/paludis/metadata_key.se
index c44df03..234f92c 100644
--- a/paludis/metadata_key.se
+++ b/paludis/metadata_key.se
@@ -7,6 +7,7 @@ make_enum_MetadataKeyType()
key mkt_significant "A key of significant interest, to be shown early on"
key mkt_normal "A normal key, to be shown underneath mkt_significant keys"
+ key mkt_author "Should only be shown if the user asks for author information"
key mkt_dependencies "Should only be shown if the user asks for dependencies"
key mkt_internal "Should not usually be displayed to the user"
diff --git a/src/clients/inquisitio/command_line.cc b/src/clients/inquisitio/command_line.cc
index 268d80a..ce260bd 100644
--- a/src/clients/inquisitio/command_line.cc
+++ b/src/clients/inquisitio/command_line.cc
@@ -79,6 +79,7 @@ CommandLine::CommandLine() :
a_compact(&output_args, "compact", '\0', "Display output using one line per entry", true),
a_show_dependencies(&output_args, "show-dependencies", 'D', "Show dependencies", true),
+ a_show_authors(&output_args, "show-authors", 'A', "Show author information", true),
a_show_metadata(&output_args, "show-metadata", 'M', "Show raw metadata", true),
deprecated_args(this, "Deprecated options", "Deprecated options."),
diff --git a/src/clients/inquisitio/command_line.hh b/src/clients/inquisitio/command_line.hh
index a1eddcd..657c298 100644
--- a/src/clients/inquisitio/command_line.hh
+++ b/src/clients/inquisitio/command_line.hh
@@ -98,6 +98,7 @@ class CommandLine :
paludis::args::ArgsGroup output_args;
paludis::args::SwitchArg a_compact;
paludis::args::SwitchArg a_show_dependencies;
+ paludis::args::SwitchArg a_show_authors;
paludis::args::SwitchArg a_show_metadata;
///\}
diff --git a/src/clients/inquisitio/query_task.cc b/src/clients/inquisitio/query_task.cc
index 52acf94..dcb349e 100644
--- a/src/clients/inquisitio/query_task.cc
+++ b/src/clients/inquisitio/query_task.cc
@@ -46,3 +46,9 @@ InquisitioQueryTask::want_compact() const
return CommandLine::get_instance()->a_compact.specified();
}
+bool
+InquisitioQueryTask::want_authors() const
+{
+ return CommandLine::get_instance()->a_show_authors.specified();
+}
+
diff --git a/src/clients/inquisitio/query_task.hh b/src/clients/inquisitio/query_task.hh
index b335ec9..e72568e 100644
--- a/src/clients/inquisitio/query_task.hh
+++ b/src/clients/inquisitio/query_task.hh
@@ -33,6 +33,7 @@ namespace inquisitio
virtual bool want_compact() const;
virtual bool want_deps() const;
virtual bool want_raw() const;
+ virtual bool want_authors() const;
};
}
diff --git a/src/clients/paludis/command_line.cc b/src/clients/paludis/command_line.cc
index 56a5571..a5f98fb 100644
--- a/src/clients/paludis/command_line.cc
+++ b/src/clients/paludis/command_line.cc
@@ -85,6 +85,7 @@ CommandLine::CommandLine() :
query_args(this, "Query options",
"Options which are relevant for --query."),
a_show_deps(&query_args, "show-deps", 'D', "Show dependencies", true),
+ a_show_authors(&query_args, "show-authors", 'A', "Show author information", true),
a_show_metadata(&query_args, "show-metadata", 'M', "Show raw metadata", true),
install_args(this, "Install, Uninstall options",
diff --git a/src/clients/paludis/command_line.hh b/src/clients/paludis/command_line.hh
index 89487aa..2c482be 100644
--- a/src/clients/paludis/command_line.hh
+++ b/src/clients/paludis/command_line.hh
@@ -186,6 +186,9 @@ class CommandLine :
/// --show-deps
paludis::args::SwitchArg a_show_deps;
+ /// --show-authors
+ paludis::args::SwitchArg a_show_authors;
+
/// --show-metadata
paludis::args::SwitchArg a_show_metadata;
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 5f59b7d..980a48d 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -58,6 +58,11 @@ namespace
return CommandLine::get_instance()->a_show_metadata.specified();
}
+ bool want_authors() const
+ {
+ return CommandLine::get_instance()->a_show_authors.specified();
+ }
+
bool want_compact() const
{
return CommandLine::get_instance()->a_compact.specified();
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 0f88877..f11f69e 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -623,6 +623,12 @@ ConsoleQueryTask::display_metadata(const PackageDepSpec &, const tr1::shared_ptr
Displayer dn(this, _imp->env, id, mkt_normal);
std::for_each(indirect_iterator(id->begin_metadata()), indirect_iterator(id->end_metadata()), accept_visitor(dn));
+ if (want_authors() || want_raw())
+ {
+ Displayer dd(this, _imp->env, id, mkt_author);
+ std::for_each(indirect_iterator(id->begin_metadata()), indirect_iterator(id->end_metadata()), accept_visitor(dd));
+ }
+
if (want_deps() || want_raw())
{
Displayer dd(this, _imp->env, id, mkt_dependencies);
diff --git a/src/output/console_query_task.hh b/src/output/console_query_task.hh
index ccd1992..f39db37 100644
--- a/src/output/console_query_task.hh
+++ b/src/output/console_query_task.hh
@@ -60,6 +60,7 @@ namespace paludis
virtual bool want_compact() const = 0;
virtual bool want_deps() const = 0;
virtual bool want_raw() const = 0;
+ virtual bool want_authors() const = 0;
const tr1::shared_ptr<const Map<char, std::string> > masks_to_explain() const;
};