diff --git a/bin/is b/bin/is index 1cf1e3553d5f8ca840eecdf91f34b1d71ed5e5b7..c24123200993ba1996c1669889d183765927c5b5 100755 --- a/bin/is +++ b/bin/is @@ -340,11 +340,12 @@ def c_install(args): arrow("Parsing arguments") args = args.parser.parse_args() # run setup scripts - image.run_setup(namespace=args) - # compute building time - t1 = time.time() - dt = int(t1 - t0) - arrow("Install time: %s" % datetime.timedelta(seconds=dt)) + if not args.dry_run: + image.run_setup(namespace=args) + # compute building time + t1 = time.time() + dt = int(t1 - t0) + arrow("Install time: %s" % datetime.timedelta(seconds=dt)) def c_list(args): ''' @@ -603,6 +604,8 @@ def arg_parser_init(): # install command parser p = subparser.add_parser("install", add_help=False, help=c_install.__doc__.lower()) + p.add_argument("--dry-run", action="store_true", + help="doesn't execute setup scripts") p.add_argument("pattern", help="path|[repository/]image[:version]") p.set_defaults(func=c_install, parser=parser, install_parser=p) # list command parser diff --git a/completion/bash/is b/completion/bash/is index 77143a55edaa8a37f3a506cf5e35b6df6865688c..1f4288f26c3d0f2ccbc0c724be62d7f7b1a49c2e 100644 --- a/completion/bash/is +++ b/completion/bash/is @@ -133,6 +133,7 @@ _is() { _local_repo ;; install) + [[ "$cur" == -* ]] && _opt '--dry-run' && return 0 _count_args (( args == 2 )) && _image (( args > 2 )) && _filedir