mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-13 18:14:24 +02:00
feat: Enable --depth flag (still does nothing)
This commit is contained in:
@@ -45,6 +45,13 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
|
|||||||
' ~/Desktop/sites_list.csv\n'
|
' ~/Desktop/sites_list.csv\n'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--depth",
|
||||||
|
action="store",
|
||||||
|
default=0,
|
||||||
|
type=int,
|
||||||
|
help="Recursively archive all linked pages up to this many hops away"
|
||||||
|
)
|
||||||
command = parser.parse_args(args or ())
|
command = parser.parse_args(args or ())
|
||||||
import_str = accept_stdin(stdin)
|
import_str = accept_stdin(stdin)
|
||||||
add(
|
add(
|
||||||
@@ -63,12 +70,6 @@ if __name__ == '__main__':
|
|||||||
# TODO: Implement these
|
# TODO: Implement these
|
||||||
#
|
#
|
||||||
# parser.add_argument(
|
# parser.add_argument(
|
||||||
# '--depth', #'-d',
|
|
||||||
# type=int,
|
|
||||||
# help='Recursively archive all linked pages up to this many hops away',
|
|
||||||
# default=0,
|
|
||||||
# )
|
|
||||||
# parser.add_argument(
|
|
||||||
# '--mirror', #'-m',
|
# '--mirror', #'-m',
|
||||||
# action='store_true',
|
# action='store_true',
|
||||||
# help='Archive an entire site (finding all linked pages below it on the same domain)',
|
# help='Archive an entire site (finding all linked pages below it on the same domain)',
|
||||||
|
@@ -0,0 +1,7 @@
|
|||||||
|
import subprocess
|
||||||
|
|
||||||
|
from .fixtures import *
|
||||||
|
|
||||||
|
def test_depth_flag_is_accepted(tmp_path, process):
|
||||||
|
arg_process = subprocess.run(["archivebox", "add", "https://example.com", "--depth=0"], capture_output=True)
|
||||||
|
assert 'unrecognized arguments: --depth' not in arg_process.stderr.decode('utf-8')
|
Reference in New Issue
Block a user