In this task, you’ll extend the functionality of your wordcount
command to read data from multiple files. You’ll handle each file separately, calculate the number of lines, words, and bytes for each, and provide a summary if multiple files are involved.
Acceptance Criteria
- Your program should correctly read data from each file specified in the command-line arguments.
- For each file, it should print the count of lines, words, and bytes on separate lines.
- If multiple files are provided, then your program should include a summary with the total counts for lines, words, and bytes.
- It should be possible to repeat the same file multiple times in the command-line arguments.
- The program should read from standard input when the dash (
-
) is provided as one or more command-line arguments. - The program should be able to mix files with standard input.
Note: You don’t need to worry about the misaligned counts across multiple lines. Fixing that will be the focus of your next task.