[Yum-devel] [PATCH] yum help and --help cleanup
James Bowes
jbowes at redhat.com
Fri Jan 25 02:18:02 UTC 2008
On Thu, Jan 24, 2008 at 08:11:45PM -0500, James Antill wrote:
>
> On Thu, 2008-01-24 at 19:32 -0500, James Bowes wrote:
> > def doCommand(self, base, basecmd, extcmds):
> > + if base.yum_cli_commands.has_key(extcmds[0]):
> > + command = base.yum_cli_commands[extcmds[0]]
> > + canonical_name = command.getNames()[0]
> > + # XXX need detailed help here, too
> > + usagestr = "%s %s\n\n%s" % (canonical_name,
> > command.getUsage(),
> > + command.getSummary())
> > + base.verbose_logger.log(logginglevels.INFO_2, usagestr)
>
> It all looks awesome, but the above needs to take into account that
> some plugins register commands and won't have the summary/usage methods.
Ahh, good point, as they mightn't subclass YumCommand.
So maybe show one or the other (usage or summary) if provided, and if
both are missing, then give a helpful error message?
-James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20080124/b54debcf/attachment.pgp
More information about the Yum-devel
mailing list