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/fseccomp/main.c | 57 ++++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 27 deletions(-) (limited to 'src/fseccomp') diff --git a/src/fseccomp/main.c b/src/fseccomp/main.c index 0b46daf65..e7823d3c5 100644 --- a/src/fseccomp/main.c +++ b/src/fseccomp/main.c @@ -22,34 +22,37 @@ int arg_quiet = 0; int arg_seccomp_error_action = SECCOMP_RET_ERRNO | EPERM; // error action: errno, log or kill +static const char *const usage_str = + "Usage:\n" + "\tfseccomp debug-syscalls\n" + "\tfseccomp debug-syscalls32\n" + "\tfseccomp debug-errnos\n" + "\tfseccomp debug-protocols\n" + "\tfseccomp protocol build list file\n" + "\tfseccomp secondary 64 file\n" + "\tfseccomp secondary 32 file\n" + "\tfseccomp secondary block file\n" + "\tfseccomp default file\n" + "\tfseccomp default file allow-debuggers\n" + "\tfseccomp default32 file\n" + "\tfseccomp default32 file allow-debuggers\n" + "\tfseccomp drop file1 file2 list\n" + "\tfseccomp drop file1 file2 list allow-debuggers\n" + "\tfseccomp drop32 file1 file2 list\n" + "\tfseccomp drop32 file1 file2 list allow-debuggers\n" + "\tfseccomp default drop file1 file2 list\n" + "\tfseccomp default drop file1 file2 list allow-debuggers\n" + "\tfseccomp default32 drop file1 file2 list\n" + "\tfseccomp default32 drop file1 file2 list allow-debuggers\n" + "\tfseccomp keep file1 file2 list\n" + "\tfseccomp keep32 file1 file2 list\n" + "\tfseccomp memory-deny-write-execute file\n" + "\tfseccomp memory-deny-write-execute.32 file\n" + "\tfseccomp restrict-namespaces file list\n" + "\tfseccomp restrict-namespaces.32 file list\n"; + static void usage(void) { - printf("Usage:\n" - "\tfseccomp debug-syscalls\n" - "\tfseccomp debug-syscalls32\n" - "\tfseccomp debug-errnos\n" - "\tfseccomp debug-protocols\n" - "\tfseccomp protocol build list file\n" - "\tfseccomp secondary 64 file\n" - "\tfseccomp secondary 32 file\n" - "\tfseccomp secondary block file\n" - "\tfseccomp default file\n" - "\tfseccomp default file allow-debuggers\n" - "\tfseccomp default32 file\n" - "\tfseccomp default32 file allow-debuggers\n" - "\tfseccomp drop file1 file2 list\n" - "\tfseccomp drop file1 file2 list allow-debuggers\n" - "\tfseccomp drop32 file1 file2 list\n" - "\tfseccomp drop32 file1 file2 list allow-debuggers\n" - "\tfseccomp default drop file1 file2 list\n" - "\tfseccomp default drop file1 file2 list allow-debuggers\n" - "\tfseccomp default32 drop file1 file2 list\n" - "\tfseccomp default32 drop file1 file2 list allow-debuggers\n" - "\tfseccomp keep file1 file2 list\n" - "\tfseccomp keep32 file1 file2 list\n" - "\tfseccomp memory-deny-write-execute file\n" - "\tfseccomp memory-deny-write-execute.32 file\n" - "\tfseccomp restrict-namespaces file list\n" - "\tfseccomp restrict-namespaces.32 file list\n"); + puts(usage_str); } int main(int argc, char **argv) { -- cgit v1.2.3-70-g09d2