]> granicus.if.org Git - strace/commitdiff
strace.c: add "-k" to strace -h list of options
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 24 Jul 2019 07:52:05 +0000 (09:52 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 4 Aug 2019 22:33:09 +0000 (22:33 +0000)
It is mentioned in the "Output format" section below, but not in the
usage section.

* strace.c (usage): Define K_OPT macro with a value that depends
on ENABLE_STACKTRACE macro presence, use it in the help output, undefine
it.

strace.c

index 5e8b0417bc66225ff36df2aa7ea56161b3a0d525..17b12dc4b71e8fab47519a23925689cd64a348e3 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -229,8 +229,14 @@ print_version(void)
 static void
 usage(void)
 {
+#ifdef ENABLE_STACKTRACE
+# define K_OPT "k"
+#else
+# define K_OPT ""
+#endif
+
        printf("\
-usage: strace [-CdffhiqrtttTvVwxxy] [-I n] [-e expr]...\n\
+usage: strace [-Cdffhi" K_OPT "qrtttTvVwxxy] [-I n] [-e expr]...\n\
               [-a column] [-o file] [-s strsize] [-P path]...\n\
               -p pid... / [-D] [-E var=val]... [-u username] PROG [ARGS]\n\
    or: strace -c[dfw] [-I n] [-e expr]... [-O overhead] [-S sortby]\n\
@@ -302,6 +308,8 @@ Miscellaneous:\n\
  */
 , DEFAULT_ACOLUMN, DEFAULT_STRLEN, DEFAULT_SORTBY);
        exit(0);
+
+#undef K_OPT
 }
 
 void ATTRIBUTE_NORETURN