aboutsummaryrefslogtreecommitdiff
path: root/src/clients/cave/cmd_print_ids.cc
diff options
context:
space:
mode:
authorAvatar Alex Elsayed <eternaleye@gmail.com> 2011-06-28 17:10:23 -0700
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-06-30 10:27:28 +0100
commit2c58ebc323b45ec1e8fa0902741fad331c1bbb7e (patch)
tree78838a79091e0780980a7a0d9d18a92ce977d976 /src/clients/cave/cmd_print_ids.cc
parente83a3ad0f53a5bd48e6f4cfdabac24914705b2ff (diff)
downloadpaludis-2c58ebc323b45ec1e8fa0902741fad331c1bbb7e.tar.gz
paludis-2c58ebc323b45ec1e8fa0902741fad331c1bbb7e.tar.xz
Start using the new format_package_id
Diffstat (limited to 'src/clients/cave/cmd_print_ids.cc')
-rw-r--r--src/clients/cave/cmd_print_ids.cc22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc
index 0c96c5d52..b3326e272 100644
--- a/src/clients/cave/cmd_print_ids.cc
+++ b/src/clients/cave/cmd_print_ids.cc
@@ -18,7 +18,7 @@
*/
#include "cmd_print_ids.hh"
-#include "format_string.hh"
+#include "format_package_id.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/name.hh>
@@ -238,24 +238,6 @@ namespace
{
}
};
-
- std::string format_id(
- const PrintIDsCommandLine & c,
- const std::shared_ptr<const PackageID> & i)
- {
- std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
- m->insert('c', stringify(i->name().category()));
- m->insert('p', stringify(i->name().package()));
- m->insert('v', stringify(i->version()));
- m->insert('s', i->slot_key() ? stringify(i->slot_key()->parse_value()) : "");
- m->insert(':', i->slot_key() ? ":" : "");
- m->insert('r', stringify(i->repository_name()));
- m->insert('F', i->canonical_form(idcf_full));
- m->insert('V', i->canonical_form(idcf_version));
- m->insert('W', i->canonical_form(idcf_no_version));
- m->insert('N', i->canonical_form(idcf_no_name));
- return format_string(c.a_format.argument(), m);
- }
}
int
@@ -328,7 +310,7 @@ PrintIDsCommand::run(
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(fg)]);
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
- cout << format_id(cmdline, *i);
+ cout << format_package_id(*i, cmdline.a_format.argument());
return EXIT_SUCCESS;
}