Skip to content

Update file path variable to hold multiple file paths #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

catatsuy
Copy link
Owner

@catatsuy catatsuy commented Apr 6, 2024

This pull request primarily focuses on enhancing the functionality of the command-line interface (CLI) in the internal/cli/cli.go file. The changes enable the CLI to handle multiple files instead of a single file. This is achieved by modifying the CLI struct and several functions within it, including Run, validateInput, replaceProcess, and filterProcess. The cli_test.go file has also been updated to test the new functionality, and a new test file testdata/testa.txt has been added.

Changes to CLI struct and functions:

  • internal/cli/cli.go: Updated the CLI struct to replace the filePath string field with a filePaths slice of strings, allowing multiple files to be processed.
  • internal/cli/cli.go: Modified the Run function to iterate over the filePaths slice and process each file. Additional code was added to handle the case when no file paths are provided. [1] [2] [3]
  • internal/cli/cli.go: The validateInput function was updated to validate each file path in the filePaths slice.
  • internal/cli/cli.go: The replaceProcess and filterProcess functions were modified to accept an io.Reader parameter, which is used to read from the file being processed.

Test updates:

Additional changes:

@catatsuy catatsuy merged commit fa8fb5c into main Apr 6, 2024
@catatsuy catatsuy deleted the feature_provide_multiple_files branch April 6, 2024 06:28
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.

1 participant