Skip to content

Commit

Permalink
Merge pull request #955 from googlefonts/argparse
Browse files Browse the repository at this point in the history
Add custom GFArgumentParser
  • Loading branch information
m4rc1e authored Oct 4, 2024
2 parents e4c6982 + 54eb161 commit f5b9e2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Lib/gftools/argparse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from argparse import ArgumentParser


class GFArgumentParser(ArgumentParser):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_argument(
"--show-tracebacks", action="store_true", help="Show tracebacks"
)
3 changes: 2 additions & 1 deletion Lib/gftools/scripts/manage_traffic_jam.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import subprocess
from rich.pretty import pprint
from gftools.logging import setup_logging
from gftools.argparse import GFArgumentParser
from gftools.push.utils import branch_matches_google_fonts_main
from gftools.push.servers import GFServers, Items
from gftools.push.items import Family, FamilyMeta
Expand Down Expand Up @@ -223,7 +224,7 @@ def update_servers(self):


def main(args=None):
parser = argparse.ArgumentParser()
parser = GFArgumentParser()
parser.add_argument("fonts_repo", type=Path)
parser.add_argument(
"-f",
Expand Down

0 comments on commit f5b9e2e

Please sign in to comment.