docs: add note in echo.c PrintHelp()

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-03-17 23:22:00 +00:00
parent 7e69b8f82a
commit f4a96e0b2e
2 changed files with 8 additions and 7 deletions

View File

@ -17,13 +17,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <dirent.h>
#include <time.h>
#include <errno.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {

View File

@ -24,6 +24,14 @@
void PrintHelp() void PrintHelp()
{ {
/**
* POSIX specification for echo specifies that
* "Implementations shall not support any options."
* but i will do this anyway.
*
* https://pubs.opengroup.org/onlinepubs/9799919799/utilities/echo.html
*/
printf("Usage: echo [OPTION]... [STRING]...\n"); printf("Usage: echo [OPTION]... [STRING]...\n");
printf("Echo the STRING(s) to standard output.\n\n"); printf("Echo the STRING(s) to standard output.\n\n");
printf(" -n do not output the trailing newline\n"); printf(" -n do not output the trailing newline\n");