1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

Userland: Write some '--help' descriptions where appropriate

This commit is contained in:
Ben Wiederhake 2020-12-05 16:22:58 +01:00 committed by Andreas Kling
parent 52a8062084
commit 4ec77ba929
32 changed files with 47 additions and 4 deletions

View file

@ -37,6 +37,7 @@ int main(int argc, char* argv[])
bool no_newline = false;
Core::ArgsParser args_parser;
args_parser.set_general_help("Paste from the clipboard to stdout.");
args_parser.add_option(print_type, "Display the copied type", "print-type", 0);
args_parser.add_option(no_newline, "Do not append a newline", "no-newline", 'n');
args_parser.parse(argc, argv);
@ -53,8 +54,7 @@ int main(int argc, char* argv[])
if (!print_type) {
printf("%s", data_and_type.data.data());
// Append a newline to text contents, but
// only if we're not asked not to do this.
// Append a newline to text contents, unless the caller says otherwise.
if (data_and_type.mime_type.starts_with("text/") && !no_newline)
putchar('\n');
} else {