Skip to content

Commit

Permalink
Add argparse option to pass custom headers (#14)
Browse files Browse the repository at this point in the history
* Add option to pass headers

* Remove -h options because is conflicting with help option
  • Loading branch information
estyxx authored Jan 8, 2025
1 parent b8aa325 commit 9cac078
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/linkcheckmd/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import argparse
import logging
import time
import json

from .base import check_links

Expand All @@ -29,6 +30,7 @@ def main():
help="head is faster but gives false positives. Get is reliable but slower",
default="get",
)
p.add_argument("--headers", help="add custom headers dictionary", type=json.loads)
p.add_argument("-v", "--verbose", action="store_true")
p.add_argument("--sync", help="don't use asyncio", action="store_true")
p.add_argument("-local", help="only check local files", action="store_true")
Expand All @@ -47,6 +49,7 @@ def main():
ext=P.ext,
domain=P.domain,
method=P.method,
hdr=P.headers,
use_async=not P.sync,
local=P.local,
recurse=P.recurse,
Expand Down

0 comments on commit 9cac078

Please sign in to comment.