From 89eb2d304027ceb2948af3ee36eaebf768281c0f Mon Sep 17 00:00:00 2001 From: Sebastien Luttringer Date: Wed, 21 Dec 2011 00:13:10 +0100 Subject: [PATCH] list filter by search path if set if no filter given, list in all online repository Also remove list -S, can be done by is -s '' --- bin/is | 10 +++++----- completion/bash/is | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/is b/bin/is index 69b7a85..e7ca646 100755 --- a/bin/is +++ b/bin/is @@ -372,11 +372,13 @@ def c_list(args): List images in repository or image content ''' repoman = load_repositories(args) - if args.search is not None: - args.search = split_repository_list(args.repo_search, lambda x: x in repoman.onlines) + if args.repo_search is None: + search = repoman.onlines + else: + search = split_repository_list(args.repo_search, lambda x: x in repoman.onlines) for pattern in args.image: show_images(repoman, pattern, - all_version=args.all_version, search=args.search, + all_version=args.all_version, search=search, o_long=args.long, o_json=args.json, o_md5=args.md5, o_date=args.date, o_author=args.author, o_size=args.size, o_url=args.url, o_description=args.description) @@ -639,8 +641,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("-S", "--search", action="store_true", default=None, - help="only list image in search path") p.add_argument("--no-sync", action="store_true", default=False, help="doesn't sync repository before listing") p.add_argument("image", nargs="*", default=['*'], diff --git a/completion/bash/is b/completion/bash/is index 5b49628..374d499 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 list --no-sync)" -- "$cur")) + COMPREPLY=("${COMPREPLY[@]}" $(compgen -W "$(is -q --no-color --repo-search '' list --no-sync)" -- "$cur")) } # list all local (files) images @@ -135,7 +135,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 -S --search --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 --no-sync' && return 0 _remote_image ;; move) -- GitLab