Include params in Method.output_params

Method overrides the Command get_output_params() method and only returns
the object params, not anything defined within the method itself. Return
those as well so they are displayed in output. Some care needs to be taken
to avoid returning duplicate values. In the case of duplicates the
value in obj.params wins.
This commit is contained in:
Rob Crittenden 2010-03-09 16:49:02 -05:00 committed by Jason Gerard DeRose
parent 1400c85188
commit b46f262a60

View File

@ -784,11 +784,13 @@ class Command(HasParam):
cli_name='all', cli_name='all',
doc=_('retrieve all attributes'), doc=_('retrieve all attributes'),
exclude='webui', exclude='webui',
flags=['no_output'],
) )
yield Flag('raw', yield Flag('raw',
cli_name='raw', cli_name='raw',
doc=_('print entries as stored on the server'), doc=_('print entries as stored on the server'),
exclude='webui', exclude='webui',
flags=['no_output'],
) )
return return
@ -1131,7 +1133,14 @@ class Method(Attribute, Command):
def get_output_params(self): def get_output_params(self):
for param in self.obj.params(): for param in self.obj.params():
if 'no_output' in param.flags:
continue
yield param yield param
for param in self.params():
if param.name not in list(self.obj.params):
if 'no_output' in param.flags:
continue
yield param
class Property(Attribute): class Property(Attribute):