add index-only option to archivebox add and update

This commit is contained in:
Nick Sweeting 2019-04-25 18:59:41 -04:00
parent 95a7d3d1de
commit d248684839
4 changed files with 19 additions and 3 deletions

View file

@ -7,6 +7,8 @@ __description__ = 'Add a new URL or list of URLs to your archive'
import sys
import argparse
from typing import List, Optional
from ..legacy.config import stderr, check_dependencies, check_data_folder
from ..legacy.util import (
handle_stdin_import,
@ -15,7 +17,7 @@ from ..legacy.util import (
from ..legacy.main import update_archive_data
def main(args=None, stdin=None):
def main(args: List[str]=None, stdin: Optional[str]=None) -> None:
check_data_folder()
args = sys.argv[1:] if args is None else args
@ -36,6 +38,11 @@ def main(args=None, stdin=None):
action='store_true',
help="Don't attempt to retry previously skipped/failed links when updating",
)
parser.add_argument(
'--index-only', #'-o',
action='store_true',
help="Add the links to the main index without archiving them",
)
# parser.add_argument(
# '--mirror', #'-m',
# action='store_true',
@ -81,6 +88,7 @@ def main(args=None, stdin=None):
import_path=import_path,
resume=None,
only_new=command.only_new,
index_only=command.index_only,
)