plugins: Invoke setup_parser_common_args explicitly from setup_parser

This allows to define plugins which do not need have any of common args.

Move setup_parser_common_args into libkas for this as it now becomes a
library function.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka
2021-07-10 11:22:34 +02:00
parent 6dd27e7c62
commit 4c975a04f9
6 changed files with 22 additions and 16 deletions

View File

@@ -359,3 +359,17 @@ def ssh_no_host_key_check():
os.mkdir(home + '/.ssh')
with open(home + '/.ssh/config', 'w') as fds:
fds.write('Host *\n\tStrictHostKeyChecking no\n\n')
def setup_parser_common_args(parser):
parser.add_argument('config',
help='Config file')
parser.add_argument('--skip',
help='Skip build steps',
default=[])
parser.add_argument('--force-checkout', action='store_true',
help='Always checkout the desired refspec of each '
'repository, discarding any local changes')
parser.add_argument('--update', action='store_true',
help='Pull new upstream changes to the desired '
'refspec even if it is already checked out locally')