feat: Enable --depth flag (still does nothing)
This commit is contained in:
parent
d5fc13b34e
commit
8b22a2a7dd
2 changed files with 14 additions and 6 deletions
|
@ -45,6 +45,13 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
|
|||
' ~/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 ())
|
||||
import_str = accept_stdin(stdin)
|
||||
add(
|
||||
|
@ -63,12 +70,6 @@ if __name__ == '__main__':
|
|||
# TODO: Implement these
|
||||
#
|
||||
# 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',
|
||||
# action='store_true',
|
||||
# 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')
|
Loading…
Reference in a new issue