diff --git a/file_tee/src/file_tee.c b/file_tee/src/file_tee.c index c24f673..6f97be5 100644 --- a/file_tee/src/file_tee.c +++ b/file_tee/src/file_tee.c @@ -1,8 +1,10 @@ #include #include -static const char Help[] = "Reads a file and outputs to a file while also printing contents."; -static const char Usage[] = "INPUT_FILE [OUTPUT_FILE]"; +static const char doc[] = +"Reads a file and outputs to a file while also printing contents.\n" +"If OUTPUT_FILE is not given, will only output to stdout"; +static const char args_doc[] = "INPUT_FILE [OUTPUT_FILE]"; struct arguments { char* inFile; @@ -11,7 +13,7 @@ struct arguments { int main(int argc, char* argv[]) { // for some reason, when doing this with a serial port, log.log never gets written to. I think this is becasue the - // program is terminated with ctrl-c, so the file descriptors dont close?. + // program is terminated with ctrl-c, so the file descriptors dont close? adding fflushes fixes it, but I shouldnt need to add that. struct arguments arguments = {NULL, NULL}; @@ -23,7 +25,7 @@ int main(int argc, char* argv[]) { arguments.inFile = argv[1]; break; default: - printf("%s\n%s\n", Usage, Help); + printf("%s\n%s\n", args_doc, doc); return EXIT_FAILURE; break; }