diff options
author | Mark Wielaard <mjw@redhat.com> | 2013-11-10 22:17:05 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2013-11-11 15:41:33 +0100 |
commit | 875cad8234a6fcbbe90686d10f135ad029ff8206 (patch) | |
tree | 948ced75b4267241df74fe2475a7d87d58e50d94 | |
parent | 3ba50403179131d6153923af71d00a909b62a147 (diff) | |
download | elfutils-875cad8234a6fcbbe90686d10f135ad029ff8206.tar.gz |
stack: Add basic argp version and bug definitions.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/stack.c | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 94bc27a9..51a5bd56 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 diff --git a/src/stack.c b/src/stack.c index 948325d4..f428ed08 100644 --- a/src/stack.c +++ b/src/stack.c @@ -27,6 +27,15 @@ #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) |