diff --git a/NEWS b/NEWS index 802bee39..f282ef3b 100644 --- a/NEWS +++ b/NEWS @@ -15,7 +15,7 @@ - osc can now store credentials in Gnome keyring if it is available - new support for osc linkpac to specify cicount attribute - new log/rlog output formats (CSV and XML) -- new jobhistory/buildhistory output format (CSV) +- new jobhistory/buildhistory/search output format (CSV) - new option to fetch buildlogs starting at given offset - new option for copypac * -r to specify source revision diff --git a/osc/commandline.py b/osc/commandline.py index 6e594776..c9bcc692 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2548,6 +2548,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='show more information') @cmdln.option('-i', '--involved', action='store_true', help='show projects/packages where given person is involved') + @cmdln.option('--csv', action='store_true', + help='generate output in CSV (separated by |)') def do_search(self, subcmd, opts, *args): """${cmd_name}: Search for a project and/or package. @@ -2604,10 +2606,11 @@ Please submit there instead, or use --nodevelproject to force direct submission. headline.append('# Title') if opts.repos_baseurl: headline.append('# URL') - if len(search_for) > 1: - print '#' * 68 - print 'matches for \'%s\' in %ss:\n' % (search_term, kind) - for row in build_table(len(headline), result, headline, 2): + if not opts.csv: + if len(search_for) > 1: + print '#' * 68 + print 'matches for \'%s\' in %ss:\n' % (search_term, kind) + for row in build_table(len(headline), result, headline, 2, csv = opts.csv): print row else: print 'No matches found for \'%s\' in %ss' % (search_term, kind)