ChangeLog, debugfs.8.in, debugfs.c:
  Add a -V option which displays the current version.
ChangeLog, unix.c:
  unix.c (e2fsck_update_progress): Remove unused variables.
ChangeLog, inode.c:
  inode.c (get_next_blockgroup): Fix bug where if get_next_blockgroup()
  	is called early because of a missing inode table in a block group, the
  	current_inode counter wasn't incremented correctly.
ChangeLog, tst_uuid.c:
  tst_uuid.c (main): Fixed bogus declaration of the main's argv parameter.
ChangeLog, test_icount.c:
  test_icount.c (main): Fix main() declaration so that it returns int,
  	not void.
Many files:
  fsck.c (ignore): Remove unused variable cp.
  chattr.c (fatal_error):
  tune2fs.c (usage):
  lsattr.c (usage):
  dumpe2fs.c (usage):
  badblocks.c (usage): Remove volatile from declaration.
  fsck.c: Change use of strdup to be string_copy, since we don't trust
  	what glibc is doing with strdup.  (Whatever it is, it isn't pretty.)

diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 3c66795..2cbad64 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -35,6 +35,8 @@
 #include "debugfs.h"
 #include "uuid/uuid.h"
 
+#include "../version.h"
+
 extern ss_request_table debug_cmds;
 
 ext2_filsys current_fs = NULL;
@@ -1353,7 +1355,7 @@
 {
 	int		retval;
 	int		sci_idx;
-	const char	*usage = "Usage: debugfs [[-w] device]";
+	const char	*usage = "Usage: debugfs [-f cmd_file] [-R request] [-V] [[-w] device]";
 	int		c;
 	int		open_flags = 0;
 	char		*request = 0;
@@ -1361,8 +1363,11 @@
 	char		*cmd_file = 0;
 	
 	initialize_ext2_error_table();
+	fprintf (stderr, "debugfs %s, %s for EXT2 FS %s, %s\n",
+		 E2FSPROGS_VERSION, E2FSPROGS_DATE,
+		 EXT2FS_VERSION, EXT2FS_DATE);
 
-	while ((c = getopt (argc, argv, "wR:f:")) != EOF) {
+	while ((c = getopt (argc, argv, "wR:f:V")) != EOF) {
 		switch (c) {
 		case 'R':
 			request = optarg;
@@ -1373,6 +1378,11 @@
 		case 'w':
 			open_flags = EXT2_FLAG_RW;
 			break;
+		case 'V':
+			/* Print version number and exit */
+			fprintf(stderr, "\tUsing %s\n",
+				error_message(EXT2_ET_BASE));
+			exit(0);
 		default:
 			com_err(argv[0], 0, usage);
 			return 1;