From bec6f53c3dba77d5fc81a2dbee976f6cf276790b Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Wed, 22 Feb 2012 17:49:41 -0800 Subject: [PATCH] munkiimport: Specify catalogs from the command-line Add a --catalog option so that we can specify the default catalogs to use from the command-line. Multiple catalogs can be specified by specifying the option multiple times. --- code/client/munkiimport | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/client/munkiimport b/code/client/munkiimport index a056eefa..d3cbc25f 100755 --- a/code/client/munkiimport +++ b/code/client/munkiimport @@ -517,6 +517,8 @@ def main(): p.add_option('--nointeractive', '-n', action='store_true', help="""No interactive prompts. May cause a failure if repo path is unavailable.""") + p.add_option('--catalog', default=[], action='append', + help="""Specify target catalogs. (default: prompt)""") p.add_option('--version', '-V', action='store_true', help='Print the version of the munki tools and exit.') @@ -646,7 +648,10 @@ def main(): pkginfo.get(key,'').encode('UTF-8'))) if newvalue: pkginfo[key] = newvalue - + + if options.catalog: + pkginfo['catalogs'] = options.catalog + newvalue = raw_input('%15s [%s]: ' % ('Catalogs', ', '.join(pkginfo['catalogs']))) if newvalue: