Skip to content

Conversation

@pditommaso
Copy link
Member

@pditommaso pditommaso commented Sep 29, 2025

Summary

Enhances ProcessEntryHandler to support comma-separated file paths for the file input type, enabling users to pass multiple files in a single parameter.

Changes

  • Add parseFileInput() helper method to handle comma-separated values
  • Support both String and GString inputs
  • Return List<Path> for multiple files, single Path for one file
  • Handle whitespace trimming and empty string filtering
  • Maintain backward compatibility with existing single file behavior
  • Add comprehensive unit tests using Spock parameterized testing

Usage

# Single file (existing behavior)
nextflow run script.nf --input file.txt

# Multiple files (new functionality)  
nextflow run script.nf --input "file1.txt,file2.txt,file3.txt"

# Handles whitespace gracefully
nextflow run script.nf --input " file1.txt , file2.txt "

🤖 Generated with Claude Code

- Add parseFileInput() helper method to handle comma-separated file paths
- Support both String and GString inputs for file parameters
- Return List<Path> for multiple files, single Path for one file
- Handle whitespace trimming and empty string filtering
- Maintain backward compatibility with existing single file behavior
- Add comprehensive unit tests using Spock parameterized testing

Usage:
- Single file: --input file.txt (returns Path object)
- Multiple files: --input "file1.txt,file2.txt,file3.txt" (returns List<Path>)
- With whitespace: --input " file1.txt , file2.txt " (handles gracefully)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@netlify
Copy link

netlify bot commented Sep 29, 2025

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit 4c3a223
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/68daeb8eccd34f00078dacb8
😎 Deploy Preview https://deploy-preview-6434--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bentsherman
Copy link
Member

Probably better to support space-separated files since it will usually be a glob pattern like file*.txt

@pditommaso
Copy link
Member Author

That can become tricky to handle file names with blanks

@bentsherman
Copy link
Member

The same problem exists for a comma-separated list -- you have to quote or escape things either way

@pditommaso
Copy link
Member Author

Nextflow CLI handles blank separated values as independent value. I mean if you have: a1.txt, a2.txt, and a3.txt

and run:

nextflow run --foo a* 

foo will be a1.txt

instead, if you wrap in quotes:

nextflow run --foo "a*"

foo will be a*

@bentsherman
Copy link
Member

I see, so it's an issue with the CLI parsing. Should be something we can address in CLI v2 then

@pditommaso
Copy link
Member Author

Yep

@pditommaso pditommaso merged commit fe62764 into master Oct 1, 2025
29 checks passed
@pditommaso pditommaso deleted the process-entry-comma-files branch October 1, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants