]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
stack: Add basic argp version and bug definitions.
authorMark Wielaard <mjw@redhat.com>
Sun, 10 Nov 2013 21:17:05 +0000 (22:17 +0100)
committerMark Wielaard <mjw@redhat.com>
Mon, 11 Nov 2013 14:41:33 +0000 (15:41 +0100)
Signed-off-by: Mark Wielaard <mjw@redhat.com>
src/ChangeLog
src/stack.c

index 94bc27a951f3c94c795f7ad6a040a69cc7edef88..51a5bd56563432feda0abdba57e8013750d603c6 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-10  Mark Wielaard  <mjw@redhat.com>
+
+       * stack.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
+       ARGP_PROGRAM_BUG_ADDRESS_DEF.
+       (print_version): New function.
+
 2013-11-09  Mark Wielaard  <mjw@redhat.com>
 
        * arlib.c (arlib_init): Call snprintf before using the result
index 948325d4770fc0360b411b4dbde8652e7d00c129..f428ed08bf76a91adf717f702b9e3bd256e7e441 100644 (file)
 #include <fcntl.h>
 #include ELFUTILS_HEADER(dwfl)
 
+#include <system.h>
+
+/* Name and version of program.  */
+static void print_version (FILE *stream, struct argp_state *state);
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+
+/* Bug report address.  */
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
+
 static bool verbose = false;
 
 static int
@@ -92,6 +101,12 @@ thread_callback (Dwfl_Thread *thread, void *thread_arg __attribute__ ((unused)))
   return DWARF_CB_OK;
 }
 
+static void
+print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
+{
+  fprintf (stream, "stack (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
+}
+
 static error_t
 parse_opt (int key, char *arg __attribute__ ((unused)),
           struct argp_state *state)