# Path: muninn/tools/utils.py
# def create_parser(*args, **kwargs):
#     parser = argparse.ArgumentParser(*args, parents=[version_parser], **kwargs)
#     parser.add_argument("--verbose", action="store_true", help="display debug information")
#     return parser
# 
# def parse_args_and_run(parser, func):
#     args, unused_args = version_parser.parse_known_args()
#     if args.version:
#         version(os.path.basename(sys.argv[0]))
#         sys.exit(0)
# 
#     args = parser.parse_args(unused_args)
# 
#     log_level = logging.DEBUG if args.verbose else logging.INFO
#     logging.basicConfig(level=log_level, format="%(levelname)s: %(message)s")
# 
#     try:
#         return func(args)
#     except SystemExit:
#         raise
#     except KeyboardInterrupt:
#         sys.exit(1)
#     except muninn.Error as error:
#         logging.error(error)
#         sys.exit(1)
#     except Exception:
#         log_internal_error()
#         sys.exit(1)
#     finally:
#         logging.shutdown()


import argparse
import logging
import muninn
    import tabulate
from datetime import timedelta
from .utils import create_parser, parse_args_and_run
        return tuple(split_name)

    raise ValueError("invalid property name: %r" % name)


def count(args):
    with muninn.open(args.archive) as archive:
        print(archive.count(args.expression))
    return 0


def uuid(args):
    with muninn.open(args.archive) as archive:
        # Collect possibly multiple sort order specifier lists into a single list.
        order_by = [] if args.order_by is None else sum(args.order_by, [])

        # Find products using the search expression and print the UUIDs of the products found.
        for product in archive.search(args.expression, order_by, args.limit, property_names=['uuid']):
            print(product.core.uuid)

    return 0


def paths(args):
    with muninn.open(args.archive) as archive:
        # Collect possibly multiple sort order specifier lists into a single list.
        order_by_default = ['+core.archive_path', '+core.physical_name']
        order_by = order_by_default if not args.order_by else sum(args.order_by, []) + order_by_default

        # Find products using the search expression and print the paths of the products found.

# Path: muninn/tools/utils.py
# def create_parser(*args, **kwargs):
#     parser = argparse.ArgumentParser(*args, parents=[version_parser], **kwargs)
#     parser.add_argument("--verbose", action="store_true", help="display debug information")
#     return parser
# 
# def parse_args_and_run(parser, func):
#     args, unused_args = version_parser.parse_known_args()
#     if args.version:
#         version(os.path.basename(sys.argv[0]))
#         sys.exit(0)
# 
#     args = parser.parse_args(unused_args)
# 
#     log_level = logging.DEBUG if args.verbose else logging.INFO
#     logging.basicConfig(level=log_level, format="%(levelname)s: %(message)s")
# 
#     try:
#         return func(args)
#     except SystemExit:
#         raise
#     except KeyboardInterrupt:
#         sys.exit(1)
#     except muninn.Error as error:
#         logging.error(error)
#         sys.exit(1)
#     except Exception:
#         log_internal_error()
#         sys.exit(1)
#     finally:
#         logging.shutdown()


# Path: muninn/tools/search.py
import argparse
import logging
import muninn
    import tabulate
from datetime import timedelta
from .utils import create_parser, parse_args_and_run

        return tuple(split_name)

    raise ValueError("invalid property name: %r" % name)


def count(args):
    with muninn.open(args.archive) as archive:
        print(archive.count(args.expression))
    return 0


def uuid(args):
    with muninn.open(args.archive) as archive:
        # Collect possibly multiple sort order specifier lists into a single list.
        order_by = [] if args.order_by is None else sum(args.order_by, [])

        # Find products using the search expression and print the UUIDs of the products found.
        for product in archive.search(args.expression, order_by, args.limit, property_names=['uuid']):
            print(product.core.uuid)

    return 0


def paths(args):
    with muninn.open(args.archive) as archive:
        # Collect possibly multiple sort order specifier lists into a single list.
        order_by_default = ['+core.archive_path', '+core.physical_name']
        order_by = order_by_default if not args.order_by else sum(args.order_by, []) + order_by_default

        # Find products using the search expression and print the paths of the products found.

        products = archive.search(args.expression, order_by, args.limit,