1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-11 16:36:14 +01:00

added new command: osc who [login]

This commit is contained in:
Juergen Weigert 2011-04-11 20:48:59 +02:00
parent 022578925b
commit 21d96a4a17

View File

@ -5922,6 +5922,25 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print ', '.join(maintainers.get(role, [])) or '-'
print
@cmdln.alias('who')
@cmdln.alias('user')
def do_whois(self, subcmd, opts, *args):
"""${cmd_name}: Show fullname and email of a buildservice user
${cmd_usage}
${cmd_option_list}
"""
apiurl = self.get_api_url()
if len(args) > 1:
raise oscerr.WrongArgs('Wrong number of arguments.')
if len(args) < 1:
if not conf.config['api_host_options'][apiurl].has_key('user'):
raise oscerr.WrongArgs('your .oscrc does not have your user name.')
args = (conf.config['api_host_options'][apiurl]['user'],)
user = get_user_data(apiurl, args[0], 'login', 'realname', 'email')
if len(user) > 0: user[1] = '"'+user[1]+'"'
print " ".join(user), "\n"
@cmdln.option('-r', '--revision', metavar='rev',
help='print out the specified revision')