aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 16:17:52 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 16:17:52 +0000
commit30395fef3fa529fab7645a49b776d3536ab674ce (patch)
tree8ddf6b6f8ced79fe264b54de225c4b9bd31ab141
parent532919d8b59ef82edaba3f903af6dfbbaca8e7d4 (diff)
downloadpaludis-30395fef3fa529fab7645a49b776d3536ab674ce.tar.gz
paludis-30395fef3fa529fab7645a49b776d3536ab674ce.tar.xz
Show mask tokens
-rw-r--r--src/clients/cave/cmd_display_resolution-fmt.hh6
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc6
-rw-r--r--src/clients/cave/cmd_show-fmt.hh16
-rw-r--r--src/clients/cave/cmd_show.cc15
4 files changed, 33 insertions, 10 deletions
diff --git a/src/clients/cave/cmd_display_resolution-fmt.hh b/src/clients/cave/cmd_display_resolution-fmt.hh
index 55d5375..36a4737 100644
--- a/src/clients/cave/cmd_display_resolution-fmt.hh
+++ b/src/clients/cave/cmd_display_resolution-fmt.hh
@@ -121,8 +121,10 @@ const auto fs_mask_by_valueless = make_format_string_fetcher("display-resolution
const auto fs_mask_by_repo_line = make_format_string_fetcher("display-resolution/mask_by_repo_line", 1)
<< param<'i'>() << param<'s'>() << "\\n";
-const auto fs_masked_by = make_format_string_fetcher("display-resolution/masked_by", 1)
- << param<'i'>() << param<'c'>() << "Masked by " << c::normal() << param<'d'>() << "\\n";
+const auto fs_masked_by = make_format_string_fetcher("display-resolution/masked_by", 2)
+ << param<'i'>() << param<'c'>() << "Masked by " << c::normal() << param<'d'>()
+ << param_if<'t'>() << c::blue_or_pink() << " [" << param<'t'>() << "]" << c::normal() << param_endif<'t'>()
+ << "\\n";
const auto fs_masked_by_explanation = make_format_string_fetcher("display-resolution/masked_by_explanation", 1)
<< param<'i'>() << param<'c'>() << "Masked by " << c::normal() << param<'d'>() << " (" << param<'x'>() << ")" << "\\n";
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index f36544b..0d9cea2 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -1020,19 +1020,19 @@ namespace
void visit(const UserMask & m) const
{
- cout << fuc(fs_masked_by(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()));
+ cout << fuc(fs_masked_by(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()), fv<'t'>(m.token()));
}
void visit(const RepositoryMask & m) const
{
- cout << fuc(fs_masked_by(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()));
+ cout << fuc(fs_masked_by(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()), fv<'t'>(m.token()));
if (! m.comment().empty())
cout << fuc(fs_mask_by_repo_line(), fv<'i'>(indent + " "), fv<'s'>(m.comment()));
}
void visit(const UnacceptedMask & m) const
{
- cout << fuc(fs_masked_by(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()));
+ cout << fuc(fs_masked_by(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()), fv<'t'>(""));
MaskedByKeyVisitor v{env, id, indent + " "};
if (! m.unaccepted_key_name().empty())
(*id->find_metadata(m.unaccepted_key_name()))->accept(v);
diff --git a/src/clients/cave/cmd_show-fmt.hh b/src/clients/cave/cmd_show-fmt.hh
index f6b7afc..075ddb4 100644
--- a/src/clients/cave/cmd_show-fmt.hh
+++ b/src/clients/cave/cmd_show-fmt.hh
@@ -84,6 +84,22 @@ const auto fs_metadata_value_human = make_format_string_fetcher("show/metadata_v
<< param_if<'p'>() << "=" << param<'p'>() << param_endif<'p'>()
<< "%{column 30}" << param<'v'>() << "\\n";
+const auto fs_mask_value_raw = make_format_string_fetcher("show/mask_value_raw", 1)
+ << " " << param<'i'>() << param<'i'>() << param<'i'>() << param<'i'>()
+ << param_if<'b'>() << c::bold_normal() << param_endif<'b'>() << param<'s'>() << c::normal()
+ << param_if<'p'>() << "=" << param<'p'>() << param_endif<'p'>()
+ << "%{column 30}" << param<'v'>()
+ << param_if<'t'>() << c::blue_or_pink() << " [" << param<'t'>() << "]" << c::normal() << param_endif<'t'>()
+ << "\\n";
+
+const auto fs_mask_value_human = make_format_string_fetcher("show/mask_value_human", 1)
+ << " " << param<'i'>() << param<'i'>() << param<'i'>() << param<'i'>()
+ << param_if<'b'>() << c::bold_normal() << param_endif<'b'>() << param<'s'>() << c::normal()
+ << param_if<'p'>() << "=" << param<'p'>() << param_endif<'p'>()
+ << "%{column 30}" << param<'v'>()
+ << param_if<'t'>() << c::blue_or_pink() << " [" << param<'t'>() << "]" << c::normal() << param_endif<'t'>()
+ << "\\n";
+
const auto fs_metadata_continued_value = make_format_string_fetcher("show/metadata_continued_value", 1)
<< " " << "%{column 30}" << param<'i'>() << param<'i'>() << param<'v'>() << "\\n";
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 9b086cf..dead782 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -1029,9 +1029,10 @@ namespace
else
{
out << fuc(
- (cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
+ (cmdline.a_raw_names.specified() ? fs_mask_value_raw() : fs_mask_value_human()),
fv<'s'>("Masked"),
fv<'v'>("by " + m.description()),
+ fv<'t'>(""),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(""),
fv<'p'>("")
@@ -1042,9 +1043,10 @@ namespace
void visit(const UnsupportedMask & m)
{
out << fuc(
- (cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
+ (cmdline.a_raw_names.specified() ? fs_mask_value_raw() : fs_mask_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? stringify(m.key()) : m.description()),
fv<'v'>(m.explanation()),
+ fv<'t'>(""),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(""),
fv<'p'>("")
@@ -1054,9 +1056,10 @@ namespace
void visit(const AssociationMask & m)
{
out << fuc(
- (cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
+ (cmdline.a_raw_names.specified() ? fs_mask_value_raw() : fs_mask_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? stringify(m.key()) : "by " + m.description()),
fv<'v'>(stringify(m.associated_package_spec())),
+ fv<'t'>(""),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(""),
fv<'p'>("")
@@ -1066,9 +1069,10 @@ namespace
void visit(const UserMask & m)
{
out << fuc(
- (cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
+ (cmdline.a_raw_names.specified() ? fs_mask_value_raw() : fs_mask_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? stringify(m.key()) : "by " + m.description()),
fv<'v'>(""),
+ fv<'t'>(m.token()),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(""),
fv<'p'>("")
@@ -1078,9 +1082,10 @@ namespace
void visit(const RepositoryMask & m)
{
out << fuc(
- (cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
+ (cmdline.a_raw_names.specified() ? fs_mask_value_raw() : fs_mask_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? stringify(m.key()) : "by " + m.description()),
fv<'v'>(stringify(m.mask_file())),
+ fv<'t'>(m.token()),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(""),
fv<'p'>("")