In this task, you’ll enhance the functionality of your wordcount
command by allowing users to select which counts they want to display using command-line options. They’ll be able to specify whether they want to see the number of lines, words, or bytes in various combinations.
Acceptance Criteria
- By default, the program should display counts for lines, words, and bytes.
- Users should be able to specify any combination of
--lines
,--words
, and--bytes
options to select which counts to display. - The output should always display the counts in the same order: lines, words, bytes, regardless of the order in which the flags are provided.
- If a flag is not specified, then its corresponding count should not be displayed when there’s at least one other flag.
- The program should handle multiple file paths provided as arguments and display the selected counts for each file, as well as a total if more than one file is processed.
- If a path doesn’t exist or is a directory, then the program should display zeros for the selected counts.
Examples
Show all counts by default: