Enforce minimum input paths and handle stdin sentinel
Update CLI validation to require at least 10 input paths, defaulting to stdin (`-`) when the argument list is empty. Refactor the path iterator to explicitly recognize the stdin sentinel, bypassing extension validation and directory expansion to ensure direct passthrough to the file buffer without triggering `stat()` or recursive traversal.
This commit is contained in:
@@ -19,12 +19,13 @@ impl PathIter {
|
||||
file_buffer: Vec::new(),
|
||||
};
|
||||
for path in paths {
|
||||
// Avoid stat() at construction time on network filesystems (Lustre, NFS)
|
||||
// where metadata operations can be 100s of milliseconds each.
|
||||
// Paths that look like sequence files are assumed to be files.
|
||||
// Anything else is treated as a potential directory and expanded lazily
|
||||
// in next(); read_dir errors are silently skipped.
|
||||
if is_fasta_or_fastq(&path) {
|
||||
// "-" is the stdin sentinel — pass it through without any extension
|
||||
// check or directory expansion.
|
||||
if path.as_os_str() == "-" {
|
||||
iter.file_buffer.push(path);
|
||||
} else if is_fasta_or_fastq(&path) {
|
||||
// Avoid stat() at construction time on network filesystems (Lustre, NFS)
|
||||
// where metadata operations can be 100s of milliseconds each.
|
||||
iter.file_buffer.push(path);
|
||||
} else {
|
||||
iter.dir_stack.push(path);
|
||||
|
||||
Reference in New Issue
Block a user