summaryrefslogtreecommitdiff
path: root/libdiskfs/opts-version.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/opts-version.c')
-rw-r--r--libdiskfs/opts-version.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/libdiskfs/opts-version.c b/libdiskfs/opts-version.c
index 6cf3ad42..9064ed07 100644
--- a/libdiskfs/opts-version.c
+++ b/libdiskfs/opts-version.c
@@ -20,9 +20,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include "priv.h"
+#include <stdio.h>
+#include <argp.h>
#include <version.h>
+#include "priv.h"
+
static void
_print_version (FILE *stream, struct argp_state *state)
{
@@ -30,16 +33,14 @@ _print_version (FILE *stream, struct argp_state *state)
/* If this is non-zero, then the program's probably defined it, so let
that take precedence over the default. */
fputs (argp_program_version, stream);
+ else if (diskfs_extra_version && *diskfs_extra_version)
+ fprintf (stream, "%s (%s) %s",
+ diskfs_server_name, diskfs_extra_version, diskfs_server_version);
else
- {
- fprintf (stream, "%s %s ", diskfs_server_name, diskfs_server_version);
- if (diskfs_extra_version[0])
- fprintf (stream, "(%s) ", diskfs_extra_version);
- }
+ fprintf (stream, "%s %s", diskfs_server_name, diskfs_server_version);
+
/* And because diskfs is big and huge, put our information out too. */
- fputs (STANDARD_HURD_VERSION (libdiskfs), stream);
-
- putc ('\n', stream);
+ fputs (STANDARD_HURD_VERSION (libdiskfs) "\n", stream);
}
void (*argp_program_version_hook) (FILE *stream, struct argp_state *state)