Author: lslezak
Date: Wed Jul 27 14:28:23 2011
New Revision: 65033
URL: http://svn.opensuse.org/viewcvs/yast?rev=65033&view=rev
Log:
- command line - properly display multiline help texts (bnc#708553)
- 2.21.7
Modified:
trunk/yast2/VERSION
trunk/yast2/library/commandline/src/CommandLine.ycp
trunk/yast2/package/yast2.changes
Modified: trunk/yast2/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/VERSION?rev=65033&r1=65032&r2=65033&view=diff
==============================================================================
--- trunk/yast2/VERSION (original)
+++ trunk/yast2/VERSION Wed Jul 27 14:28:23 2011
@@ -1 +1 @@
-2.21.6
+2.21.7
Modified: trunk/yast2/library/commandline/src/CommandLine.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/commandline/src/CommandLine.ycp?rev=65033&r1=65032&r2=65033&view=diff
==============================================================================
--- trunk/yast2/library/commandline/src/CommandLine.ycp (original)
+++ trunk/yast2/library/commandline/src/CommandLine.ycp Wed Jul 27 14:28:23 2011
@@ -507,6 +507,11 @@
{
helptext = ((map)opthelp)[action]:"";
}
+ if (is(opthelp, list<string>))
+ {
+ string delim = sformat("\n %1 %2 ", String::Pad("",longestopt), String::Pad("", longestarg));
+ helptext = mergestring((list<string>)opthelp, delim);
+ }
else
{
y2error("Invalid data type of help text, only 'string' or 'map' types are allowed.");
@@ -603,8 +608,35 @@
});
maplist(string cmd, map desc, modulecommands["actions"]:$[], ``{
- // translators: error message: module does not provide any help messages
- Print(sformat(" %1 %2", String::Pad(cmd, longest), desc["help"]:_("No help available.")));
+ if (!haskey(desc, "help"))
+ {
+ // translators: error message: module does not provide any help messages
+ Print(sformat(" %1 %2", String::Pad(cmd, longest), _("No help available.")));
+ }
+ if (is(desc["help"]:nil, string))
+ {
+ Print(sformat(" %1 %2", String::Pad(cmd, longest), desc["help"]:""));
+ }
+ // multiline help text
+ else if (is(desc["help"]:nil, list<string>))
+ {
+ list<string> help = (list<string>)desc["help"]:[];
+
+ if (size(help) > 0)
+ {
+ Print(sformat(" %1 %2", String::Pad(cmd, longest), help[0]:""));
+ help = remove(help, 0);
+ }
+
+ foreach(string h, help, {
+ Print(sformat(" %1 %2", String::Pad("", longest), h));
+ });
+ }
+ else
+ {
+ // fallback message - invalid help has been provided by the yast module
+ Print(sformat(" %1 %2", String::Pad(cmd, longest), _("")));
+ }
});
Print("");
if( ! interactive ) {
Modified: trunk/yast2/package/yast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=65033&r1=65032&r2=65033&view=diff
==============================================================================
--- trunk/yast2/package/yast2.changes (original)
+++ trunk/yast2/package/yast2.changes Wed Jul 27 14:28:23 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Jul 27 09:29:36 UTC 2011 - lslezak@suse.cz
+
+- command line - properly display multiline help texts (bnc#708553)
+- 2.21.7
+
+-------------------------------------------------------------------
Fri Jul 22 16:18:30 CEST 2011 - mvidner@suse.cz
- FCoE detection in NetworkStorage::isDiskOnNetwork (bnc#677251, FATE#306855).
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org