1
0
Fork 0
mirror of synced 2024-06-03 02:54:32 +12:00

add tag support to schedule command

This commit is contained in:
Nick Sweeting 2024-01-03 20:31:14 -08:00
parent f775da299a
commit 8ab17f0561
2 changed files with 9 additions and 0 deletions

View file

@ -39,6 +39,12 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
default=None, default=None,
help='Run ArchiveBox once every [timeperiod] (hour/day/month/year or cron format e.g. "0 0 * * *")', help='Run ArchiveBox once every [timeperiod] (hour/day/month/year or cron format e.g. "0 0 * * *")',
) )
parser.add_argument(
'--tag', '-t',
type=str,
default='',
help="Tag the added URLs with the provided tags e.g. --tag=tag1,tag2,tag3",
)
parser.add_argument( parser.add_argument(
'--depth', # '-d', '--depth', # '-d',
type=int, type=int,
@ -97,6 +103,7 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
run_all=command.run_all, run_all=command.run_all,
quiet=command.quiet, quiet=command.quiet,
every=command.every, every=command.every,
tag=command.tag,
depth=command.depth, depth=command.depth,
overwrite=command.overwrite, overwrite=command.overwrite,
update=command.update, update=command.update,

View file

@ -1170,6 +1170,7 @@ def schedule(add: bool=False,
run_all: bool=False, run_all: bool=False,
quiet: bool=False, quiet: bool=False,
every: Optional[str]=None, every: Optional[str]=None,
tag: str='',
depth: int=0, depth: int=0,
overwrite: bool=False, overwrite: bool=False,
update: bool=not ONLY_NEW, update: bool=not ONLY_NEW,
@ -1203,6 +1204,7 @@ def schedule(add: bool=False,
'add', 'add',
*(['--overwrite'] if overwrite else []), *(['--overwrite'] if overwrite else []),
*(['--update'] if update else []), *(['--update'] if update else []),
*([f'--tag={tag}'] if tag else []),
f'--depth={depth}', f'--depth={depth}',
f'"{import_path}"', f'"{import_path}"',
] if import_path else ['update']), ] if import_path else ['update']),