From 15ad8696c7cf95059f163b4f7ed86ca697e8fe1e Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Thu, 11 May 2023 18:51:02 -0300 Subject: Move usage text into usage_str var For consistency and readability. Note: This also makes exactly one extra blank line be printed at the end of every usage text, which is currently only done in the following files: * src/fcopy/main.c * src/fnettrace-dns/main.c * src/fnettrace-icmp/main.c * src/fnettrace-sni/main.c * src/fnettrace/main.c * src/profstats/main.c --- src/fcopy/main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/fcopy') diff --git a/src/fcopy/main.c b/src/fcopy/main.c index ce2efb295..a56e8a91b 100644 --- a/src/fcopy/main.c +++ b/src/fcopy/main.c @@ -416,18 +416,19 @@ static void duplicate_link(const char *src, const char *dest, struct stat *s) { free(rdest); } +static const char *const usage_str = + "Usage: fcopy [--follow-link] src dest\n" + "\n" + "Copy SRC to DEST/SRC. SRC may be a file, directory, or symbolic link.\n" + "If SRC is a directory it is copied recursively. If it is a symlink,\n" + "the link itself is duplicated, unless --follow-link is given,\n" + "in which case the destination of the link is copied.\n" + "DEST must already exist and must be a directory.\n"; static void usage(void) { - fputs("Usage: fcopy [--follow-link] src dest\n" - "\n" - "Copy SRC to DEST/SRC. SRC may be a file, directory, or symbolic link.\n" - "If SRC is a directory it is copied recursively. If it is a symlink,\n" - "the link itself is duplicated, unless --follow-link is given,\n" - "in which case the destination of the link is copied.\n" - "DEST must already exist and must be a directory.\n", stderr); + fputs(usage_str, stderr); } - int main(int argc, char **argv) { #if 0 { -- cgit v1.2.3-70-g09d2