Commit 89eb2d30 authored by Sebastien Luttringer's avatar Sebastien Luttringer
Browse files

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 ''
parent 0bde197d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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=['*'],
+2 −2
Original line number Diff line number Diff line
@@ -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)