Should my cat utility support multiple keys simultaneously?
0
votes
1
answer
99
views
So, i was given a task to implement simple version of cat utility. It should support some of GNU keys, for given text returns the same results as real cat utility and i was given this synopsis:
cat [OPTION] [FILE]...
What i want to know can my utility be called with multiple keys or just with one?
cat -b file
or
cat -b -s -e file
[POSIX](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/)(in BaseDefinions, chapter 12) says:
> The notation used for the **SYNOPSIS** sections **imposes requirements on the implementors of the standard utilities** and provides a simple reference for the application developer or system user.
And it the same chapter [POSIX](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/) says:
> Ellipses ( "..." ) are used to denote that **one or more** occurrences of an operand **are allowed**.
---
So if **OPTION** can be repeated, why there is no ellipsis after it in synopsis? For example, there is an ellipsis [man7.org](https://man7.org/linux/man-pages/man1/cat.1.html) :
-plaintext
cat [OPTION]... [FILE]...
but not [gnu.org](https://www.gnu.org/software/coreutils/manual/html_node/cat-invocation.html)( but this cat allows many options):
-plaintext
cat [option] [file]...
Can someone explain should my program work with many keys at a time and why? And why [gnu.org](https://www.gnu.org/software/coreutils/manual/html_node/cat-invocation.html) doesn't follow this(ellipsis) utility syntax convetion?
Asked by Mark
(99 rep)
May 29, 2025, 11:14 AM
Last activity: May 29, 2025, 05:35 PM
Last activity: May 29, 2025, 05:35 PM