diff options
| author | hathach <[email protected]> | 2024-05-10 10:30:47 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-05-10 10:30:47 +0700 |
| commit | 2f5db37c1aea932845c2de8fe5bb4b1b08b24722 (patch) | |
| tree | 785939a1372b01f094434179d863b907323d0914 | |
| parent | ba6babf570752a28379aab51d9c27e7b9efe872d (diff) | |
use argparse instead of click to fix cifuzz.yml
| -rw-r--r-- | .github/workflows/cifuzz.yml | 1 | ||||
| -rw-r--r-- | tools/get_deps.py | 25 |
2 files changed, 15 insertions, 11 deletions
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml index faa0f911c..622d261a0 100644 --- a/.github/workflows/cifuzz.yml +++ b/.github/workflows/cifuzz.yml @@ -12,7 +12,6 @@ on: - '**.h' jobs: Fuzzing: - if: false runs-on: ubuntu-latest steps: - name: Build Fuzzers diff --git a/tools/get_deps.py b/tools/get_deps.py index bca38fc80..2359b4bd0 100644 --- a/tools/get_deps.py +++ b/tools/get_deps.py @@ -1,4 +1,4 @@ -import click +import argparse import sys import subprocess from pathlib import Path @@ -238,28 +238,33 @@ def find_family(board): return None [email protected]('family', nargs=-1, required=False) [email protected]('-b', '--board', multiple=True, default=None, help='Boards to fetch') -def main(family, board): - if len(family) == 0 and len(board) == 0: +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('families', nargs='*', default=[], help='Families to fetch') + parser.add_argument('-b', '--board', action='append', default=[], help='Boards to fetch') + args = parser.parse_args() + + families = args.families + board = args.board + + if len(families) == 0 and len(board) == 0: print("Please specify family or board to fetch") return status = 0 deps = list(deps_mandatory.keys()) - if 'all' in family: + if 'all' in families: deps += deps_optional.keys() else: - family = list(family) + families = list(families) if board is not None: for b in board: f = find_family(b) if f is not None: - family.append(f) + families.append(f) - for f in family: + for f in families: for d in deps_optional: if f in deps_optional[d][2]: deps.append(d) |
