diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-12-11 14:07:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-12-11 14:07:31 +0100 |
| commit | b84286970f6eb6ef879dd59f89b1826b3aa6bb46 (patch) | |
| tree | 4d3143601cc6b5e76458e032bd72d82eaad19877 | |
| parent | c6a43954d253842cf104b994ed20cbdb2ae8aee3 (diff) | |
Error if -t is specified multiple times.
| -rwxr-xr-x | cdist | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1014,7 +1014,7 @@ def main(): parser.add_argument('-c', '--checkout', help='string to pass to git for checkout') parser.add_argument('-o', '--output', help='output directory', default='.') parser.add_argument('-q', '--quiet', help='be quiet', action='store_true') - parser.add_argument('-t', '--target', help='target') + parser.add_argument('-t', '--target', help='target', action='append') parser.add_argument('-k', '--keep', help='keep working tree', action='store_true') parser.add_argument('--debug', help='build with debugging symbols where possible', action='store_true') parser.add_argument('-w', '--work', help='override default work directory') @@ -1028,6 +1028,14 @@ def main(): parser.add_argument('--ccache', help='use ccache', action='store_true') args = parser.parse_args() + # Check for incorrect multiple parameters + if args.target is not None: + if len(args.target) > 1: + parser.error('multiple -t options specified') + sys.exit(1) + else: + args.target = args.target[0] + # Override configured stuff if args.git_prefix is not None: config.set('git_prefix', args.git_prefix) |
