Commit 8c02a507 authored by Sebastien Luttringer's avatar Sebastien Luttringer
Browse files

add --dry-run option to install command

this allow to run parser script without running setup script
useful to valid arguments without causing trouble
parent dd32db4b
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -340,6 +340,7 @@ def c_install(args):
    arrow("Parsing arguments")
    args = args.parser.parse_args()
    # run setup scripts
    if not args.dry_run:
        image.run_setup(namespace=args)
        # compute building time
        t1 = time.time()
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ _is() {
         _local_repo
      ;;
      install)
         [[ "$cur" == -* ]] && _opt '--dry-run' && return 0
         _count_args
         (( args == 2 )) && _image
         (( args > 2 )) && _filedir