1
0
Fork 0
mirror of synced 2024-06-27 02:20:36 +12:00

ignore stdin when passed instead of throwing an error

This commit is contained in:
Nick Sweeting 2021-04-23 23:46:43 -04:00
parent 431020e6e4
commit 06f6084e3b

View file

@ -108,12 +108,12 @@ def reject_stdin(caller: str, stdin: Optional[IO]=sys.stdin) -> None:
if not stdin.isatty():
# stderr('READING STDIN TO REJECT...')
stdin_raw_text = stdin.read()
if stdin_raw_text:
if stdin_raw_text.strip():
# stderr('GOT STDIN!', len(stdin_str))
stderr(f'[X] The "{caller}" command does not accept stdin.', color='red')
stderr(f'[!] The "{caller}" command does not accept stdin (ignoring).', color='red')
stderr(f' Run archivebox "{caller} --help" to see usage and examples.')
stderr()
raise SystemExit(1)
# raise SystemExit(1)
return None