mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
Merge pull request #2635 from hathach/fix-cifuzz
use argparse instead of click to fix cifuzz.yml
This commit is contained in:
commit
e827829850
1
.github/workflows/cifuzz.yml
vendored
1
.github/workflows/cifuzz.yml
vendored
@ -12,7 +12,6 @@ on:
|
|||||||
- '**.h'
|
- '**.h'
|
||||||
jobs:
|
jobs:
|
||||||
Fuzzing:
|
Fuzzing:
|
||||||
if: false
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Build Fuzzers
|
- name: Build Fuzzers
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import click
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -238,28 +238,33 @@ def find_family(board):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
def main():
|
||||||
@click.argument('family', nargs=-1, required=False)
|
parser = argparse.ArgumentParser()
|
||||||
@click.option('-b', '--board', multiple=True, default=None, help='Boards to fetch')
|
parser.add_argument('families', nargs='*', default=[], help='Families to fetch')
|
||||||
def main(family, board):
|
parser.add_argument('-b', '--board', action='append', default=[], help='Boards to fetch')
|
||||||
if len(family) == 0 and len(board) == 0:
|
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")
|
print("Please specify family or board to fetch")
|
||||||
return
|
return
|
||||||
|
|
||||||
status = 0
|
status = 0
|
||||||
deps = list(deps_mandatory.keys())
|
deps = list(deps_mandatory.keys())
|
||||||
|
|
||||||
if 'all' in family:
|
if 'all' in families:
|
||||||
deps += deps_optional.keys()
|
deps += deps_optional.keys()
|
||||||
else:
|
else:
|
||||||
family = list(family)
|
families = list(families)
|
||||||
if board is not None:
|
if board is not None:
|
||||||
for b in board:
|
for b in board:
|
||||||
f = find_family(b)
|
f = find_family(b)
|
||||||
if f is not None:
|
if f is not None:
|
||||||
family.append(f)
|
families.append(f)
|
||||||
|
|
||||||
for f in family:
|
for f in families:
|
||||||
for d in deps_optional:
|
for d in deps_optional:
|
||||||
if f in deps_optional[d][2]:
|
if f in deps_optional[d][2]:
|
||||||
deps.append(d)
|
deps.append(d)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user