diff --git a/bin/is b/bin/is index e7ca6462fb4c37db4353168fd76e00d5c2d2a582..7ac4382d1c0f0b8b59fc3c0c29562db3da6540e0 100755 --- a/bin/is +++ b/bin/is @@ -46,12 +46,12 @@ def load_repositories(args): if args.repo_path is not None: repoman.register(RepositoryConfig(istools.smd5sum(args.repo_path)[:8], path=args.repo_path), temp=True, - nosync=hasattr(args, "no_sync") and args.no_sync, + nosync=args.no_sync, offline=hasattr(args, "force_offline") and args.force_offline) # load repo configs from config for repoconf in RepoConfigFile(args.repo_config).repos: repoman.register(repoconf, - nosync=hasattr(args, "no_sync") and args.no_sync, + nosync=args.no_sync, offline=hasattr(args, "force_offline") and args.force_offline) return repoman @@ -486,7 +486,9 @@ def parser_init(): parser.add_argument("-t", "--timeout", dest="timeout", type=int, default=None, metavar="SECONDS", help="download timeout (default 3)") parser.add_argument("--no-cache", action="store_true", default=None, - help="not use persistent db caching") + help="not use persistent database caching") + parser.add_argument("--no-sync", action="store_true", default=False, + help="doesn't sync repository database cache") parser.add_argument("--no-color", action="store_true", default=None, help="dot not display colored output") # create a subparser for commands @@ -641,8 +643,6 @@ def parser_init(): help="display image size") p.add_argument("-u", "--url", action="store_true", default=False, help="display image url") - p.add_argument("--no-sync", action="store_true", default=False, - help="doesn't sync repository before listing") p.add_argument("image", nargs="*", default=['*'], help="image syntax is [repository/]image[:version]") p.set_defaults(func=c_list) diff --git a/completion/bash/is b/completion/bash/is index 374d499f0b6669f5b0361bc62fe29eea570d82e3..c9ae2e901cb9234fe7d9dce0ec403cf29426a555 100644 --- a/completion/bash/is +++ b/completion/bash/is @@ -13,7 +13,7 @@ _repo() { # list all images available in any online repositories _remote_image() { - COMPREPLY=("${COMPREPLY[@]}" $(compgen -W "$(is -q --no-color --repo-search '' list --no-sync)" -- "$cur")) + COMPREPLY=("${COMPREPLY[@]}" $(compgen -W "$(is -q --no-color --no-sync --repo-search '' list)" -- "$cur")) } # list all local (files) images @@ -53,7 +53,9 @@ _is() { '-c' '--config' '-C' '--cache' '-t' '--timeout' - '--no-cache' '--no-color') + '--no-cache' + '--no-color' + '--no-sync') case "$arg" in '') @@ -135,7 +137,7 @@ _is() { (( args > 2 )) && _filedir ;; list) - [[ "$cur" == -* ]] && _opt '-h --help -l --long -j --json -m --md5 -s --size -d --date -a --all-version -A --author -u --url -D --description --no-sync' && return 0 + [[ "$cur" == -* ]] && _opt '-h --help -l --long -j --json -m --md5 -s --size -d --date -a --all-version -A --author -u --url -D --description' && return 0 _remote_image ;; move)