mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 06:34:16 +00:00
use index.LINK_FILTERS to validate filter-type args instead of hardocding them twice
This commit is contained in:
parent
c28ad8bd1b
commit
9ce3bd5bdc
2 changed files with 6 additions and 4 deletions
|
@ -12,6 +12,7 @@ from ..main import list_all
|
|||
from ..util import docstring
|
||||
from ..config import OUTPUT_DIR
|
||||
from ..index import (
|
||||
LINK_FILTERS,
|
||||
get_indexed_folders,
|
||||
get_archived_folders,
|
||||
get_unarchived_folders,
|
||||
|
@ -96,9 +97,9 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
|
|||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
'--filter-type',
|
||||
'--filter-type', '-t',
|
||||
type=str,
|
||||
choices=('exact', 'substring', 'domain', 'regex', 'tag', 'search'),
|
||||
choices=(*LINK_FILTERS.keys(), 'search'),
|
||||
default='exact',
|
||||
help='Type of pattern matching to use when filtering URLs',
|
||||
)
|
||||
|
|
|
@ -12,6 +12,7 @@ from ..main import update
|
|||
from ..util import docstring
|
||||
from ..config import OUTPUT_DIR
|
||||
from ..index import (
|
||||
LINK_FILTERS,
|
||||
get_indexed_folders,
|
||||
get_archived_folders,
|
||||
get_unarchived_folders,
|
||||
|
@ -89,9 +90,9 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
|
|||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
'--filter-type',
|
||||
'--filter-type', '-t',
|
||||
type=str,
|
||||
choices=('exact', 'substring', 'domain', 'regex', 'tag', 'search'),
|
||||
choices=(*LINK_FILTERS.keys(), 'search'),
|
||||
default='exact',
|
||||
help='Type of pattern matching to use when filtering URLs',
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue