diff options
-rw-r--r-- | src/clients/cave/cmd_print_dependent_ids.cc | 8 | ||||
-rw-r--r-- | src/clients/cave/cmd_print_ids.cc | 8 | ||||
-rw-r--r-- | src/clients/cave/cmd_print_owners.cc | 8 | ||||
-rw-r--r-- | src/clients/cave/format_package_id.cc | 13 | ||||
-rw-r--r-- | src/clients/cave/format_package_id.hh | 2 |
5 files changed, 17 insertions, 22 deletions
diff --git a/src/clients/cave/cmd_print_dependent_ids.cc b/src/clients/cave/cmd_print_dependent_ids.cc index ba5817d4c..ebc11422f 100644 --- a/src/clients/cave/cmd_print_dependent_ids.cc +++ b/src/clients/cave/cmd_print_dependent_ids.cc @@ -79,13 +79,7 @@ namespace PrintDependentIDsCommandLine() : g_display_options(main_options_section(), "Display Options", "Controls the output format."), - a_format(&g_display_options, "format", 'f', "Select the output format. Special tokens recognised are " - "%c for category, %p for package, %v for version, %s for slot, %S for slot in its native format, " - "%: for ':' if we have a slot and " - "empty otherwise, %r for repository, %F for the canonical full form, %V for the canonical full " - "version, %W for the canonical full unversioned form, %N for the canonical full unnamed form, " - "%u for a uniquely identifying dependency spec, " - "\\n for newline, \\t for tab. Default is '%F\\n'.") + a_format(&g_display_options, "format", 'f', format_package_id_help) { add_usage_line("spec"); a_format.set_argument("%F\\n"); diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc index bf8e12886..3c29f5f65 100644 --- a/src/clients/cave/cmd_print_ids.cc +++ b/src/clients/cave/cmd_print_ids.cc @@ -106,13 +106,7 @@ namespace ("unsupported", "masked because it is unsupported") ), g_display_options(main_options_section(), "Display Options", "Controls the output format."), - a_format(&g_display_options, "format", 'f', "Select the output format. Special tokens recognised are " - "%c for category, %p for package, %v for version, %s for slot, %S for slot in its native format, " - "%: for ':' if we have a slot and " - "empty otherwise, %r for repository, %F for the canonical full form, %V for the canonical full " - "version, %W for the canonical full unversioned form, %N for the canonical full unnamed form, " - "%u for a uniquely identifying dependency spec, " - "\\n for newline, \\t for tab. Default is '%F\\n'.") + a_format(&g_display_options, "format", 'f', format_package_id_help) { add_usage_line("[ --matching spec ] [ --supporting action ] [ --with-mask mask-kind ]"); a_format.set_argument("%F\\n"); diff --git a/src/clients/cave/cmd_print_owners.cc b/src/clients/cave/cmd_print_owners.cc index a90047cba..a8638251a 100644 --- a/src/clients/cave/cmd_print_owners.cc +++ b/src/clients/cave/cmd_print_owners.cc @@ -80,13 +80,7 @@ namespace "times, only IDs matching every spec are selected.", args::StringSetArg::StringSetArgOptions()), g_display_options(main_options_section(), "Display Options", "Controls the output format."), - a_format(&g_display_options, "format", 'f', "Select the output format. Special tokens recognised are " - "%c for category, %p for package, %v for version, %s for slot, %S for slot in its native format, " - "%: for ':' if we have a slot and " - "empty otherwise, %r for repository, %F for the canonical full form, %V for the canonical full " - "version, %W for the canonical full unversioned form, %N for the canonical full unnamed form, " - "%u for a uniquely identifying dependency spec, " - "\\n for newline, \\t for tab. Default is '%F\\n'.") + a_format(&g_display_options, "format", 'f', format_package_id_help) { add_usage_line("[ --type algorithm ] [ --matching spec ] pattern"); a_format.set_argument("%F\\n"); diff --git a/src/clients/cave/format_package_id.cc b/src/clients/cave/format_package_id.cc index 3e12359ee..d75e741d2 100644 --- a/src/clients/cave/format_package_id.cc +++ b/src/clients/cave/format_package_id.cc @@ -48,6 +48,9 @@ paludis::cave::format_package_id( m->insert('s', id->slot_key() ? stringify(id->slot_key()->parse_value().parallel_value()) : ""); m->insert('S', id->slot_key() ? stringify(id->slot_key()->parse_value().raw_value()) : ""); m->insert(':', id->slot_key() ? ":" : ""); + m->insert('I', stringify(id->name().category()) + '/' + stringify(id->name().package()) + + (id->slot_key() ? + ":" + stringify(id->slot_key()->parse_value().parallel_value()) : "")); m->insert('r', stringify(id->repository_name())); m->insert('F', id->canonical_form(idcf_full)); m->insert('V', id->canonical_form(idcf_version)); @@ -57,4 +60,12 @@ paludis::cave::format_package_id( return format_string(format, m); } - +const std::string paludis::cave::format_package_id_help( + "Select the output format. Special tokens recognised are " + "%c for category, %p for package, %v for version, %s for slot, %S for slot in its native format, " + "%: for ':' if we have a slot and " + "empty otherwise, %r for repository, %F for the canonical full form, %V for the canonical full " + "version, %W for the canonical full unversioned form, %N for the canonical full unnamed form, " + "%u for a uniquely identifying dependency spec, %I is equivalent to %c/%p%:%s," + "\\n for newline, \\t for tab. Default is '%F\\n'." +); diff --git a/src/clients/cave/format_package_id.hh b/src/clients/cave/format_package_id.hh index 7cb81c2e9..b03c72187 100644 --- a/src/clients/cave/format_package_id.hh +++ b/src/clients/cave/format_package_id.hh @@ -35,6 +35,8 @@ namespace paludis const std::shared_ptr<const PackageID> & id, const std::string & format) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result)); + + extern const std::string format_package_id_help; } } |