Skip to content

Commit 9a125b9

Browse files
authored
BUG: allow for longer lists of identifiers for cli commands (#144)
Prior to this, string parameter was checked whether it is a path, causing runtime error due to length exceeding maximum file path allowed on the system.
1 parent 890b74f commit 9a125b9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

idc_index/cli.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
logger_cli.setLevel(logging.INFO)
1919

2020

21+
def _get_max_path_length():
22+
# can make this more robust
23+
return 260
24+
25+
2126
@click.group()
2227
def idc():
2328
"""`idc` is a command line interface to the API functionality available in idc-index."""
@@ -333,7 +338,10 @@ def download(generic_argument, download_dir, dir_template, log_level):
333338
else:
334339
download_dir = Path.cwd()
335340

336-
if Path(generic_argument).is_file():
341+
if (
342+
len(generic_argument) < _get_max_path_length()
343+
and Path(generic_argument).is_file()
344+
):
337345
# Parse the input parameters and pass them to IDC
338346
logger_cli.info("Detected manifest file, downloading from manifest.")
339347
client.download_from_manifest(

0 commit comments

Comments
 (0)