~michel-slm/myrepos-utils

ref: 3399f8443ecedd46121e9673e1db7dc8c896de16 myrepos-utils/myrepos_utils/cli.py -rw-r--r-- 713 bytes
3399f844Michel Alexandre Salim Also include requirements; bump version for packaging fixes 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# (c) Michel Alexandre Salim
#
# Fedora-License-Identifier: GPLv2+
# SPDX-2.0-License-Identifier: GPL-2.0+
# SPDX-3.0-License-Identifier: GPL-2.0-or-later
#
# This program is free software.
# For more information on the license, see COPYING.md.
# For more information on free software, see
# <https://www.gnu.org/philosophy/free-sw.en.html>.

import click
import json
import sys
from . import utils


@click.group()
def cli():
    pass


@cli.command(help="find repo directories tracked by myrepos")
@click.argument("query", nargs=-1)
def find(query: list[str]):
    import os

    matches = utils.find_repo(query)
    for repo in matches:
        click.echo(repo)