From 93fc31a02a95fe6b391cf8ef8ac8b31ddea72525 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Kupec?= Date: Sat, 10 Oct 2009 15:31:43 +0200 Subject: [PATCH] Nicer and translated repository details. --- src/Table.cc | 1 + src/Table.h | 1 + src/repos.cc | 45 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/Table.cc b/src/Table.cc index e1d9017..7962b3a 100644 --- a/src/Table.cc +++ b/src/Table.cc @@ -30,6 +30,7 @@ const char * lines[][3] = { { "\xE2\x94\x82", "\xE2\x95\x90", "\xE2\x95\xAA"}, ///< v light, h double { "\xE2\x94\x83", "\xE2\x94\x80", "\xE2\x95\x82"}, ///< v heavy, h light { "\xE2\x95\x91", "\xE2\x94\x80", "\xE2\x95\xAB"}, ///< v double, h light + { ":", "-", "+" }, ///< colon separated values }; void TableRow::add (const string& s) { diff --git a/src/Table.h b/src/Table.h index 5ec80a0..e4a30bb 100644 --- a/src/Table.h +++ b/src/Table.h @@ -31,6 +31,7 @@ enum TableLineStyle { LightDouble, HeavyLight, DoubleLight, + Colon, none, _End, ///< sentinel }; diff --git a/src/repos.cc b/src/repos.cc index e113c55..7af01b7 100644 --- a/src/repos.cc +++ b/src/repos.cc @@ -800,10 +800,53 @@ static void print_repo_list(Zypper & zypper, static void print_repo_details(Zypper & zypper, list & repos) { + bool another = false; for_(it, repos.begin(), repos.end()) { + if (another) + cout << endl; + RepoInfo repo = *it; - cout << repo << endl; + Table t; + t.lineStyle(::Colon); + t.allowAbbrev(1); + + TableRow tr; tr << _("Alias") << repo.alias(); t << tr; + TableRow tr_name; tr_name << _("Name") << repo.name(); t << tr_name; + TableRow tr_uri; tr_uri << _("URI") << repo.url().asString(); t << tr_uri; + TableRow tr_en; + tr_en << _("Enabled") << (repo.enabled() ? _("Yes") : _("No")); + t << tr_en; + TableRow tr_prio; + tr_prio << _("Priority") << str::form("%d", repo.priority()); + t << tr_prio; + TableRow tr_ref; + tr_ref << _("Auto-refresh") << (repo.autorefresh() ? _("On") : _("Off")); + t << tr_ref; + TableRow tr_keep; + tr_keep << _("Keep Packages") << (repo.keepPackages() ? _("On") : _("Off")); + t << tr_keep; + TableRow tr_type; + tr_type << _("Type") << repo.type().asString(); + t << tr_type; + TableRow tr_gpg; + tr_gpg << _("GPG Check") << (repo.gpgCheck() ? _("On") : _("Off")); + t << tr_gpg; + TableRow tr_gpg_key; + tr_gpg_key << _("GPG Key URI") << repo.gpgKeyUrl().asString(); + t << tr_gpg_key; + TableRow tr_path; + tr_path << _("Path Prefix") << repo.path().asString(); + t << tr_path; + TableRow tr_srv; + tr_srv << _("Parent Service") << repo.service(); + t << tr_srv; + TableRow tr_mdpath; + tr_mdpath << _("MD Cache Path") << repo.metadataPath().asString(); + t << tr_mdpath; + + cout << t; + another = true; } } -- 2.7.4