diff options
author | Theodore Ts'o <tytso@mit.edu> | 1997-04-29 15:29:49 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 1997-04-29 15:29:49 +0000 |
commit | 5c576477ccb2f0ca8c5d5af2e2354fd8eeff1589 (patch) | |
tree | 23bf89a13feb18647bdd81622c9f900634093eac /misc/dumpe2fs.c | |
parent | ef423288716bf9662b952eb5e694a54a5b077240 (diff) | |
download | e2fsprogs-5c576477ccb2f0ca8c5d5af2e2354fd8eeff1589.tar.gz |
Many files:
Checked in e2fsprogs 1.06
Diffstat (limited to 'misc/dumpe2fs.c')
-rw-r--r-- | misc/dumpe2fs.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index 740f01bc..069ad644 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -39,7 +39,7 @@ char * device_name = NULL; static volatile void usage (void) { - fprintf (stderr, "usage: %s device\n", program_name); + fprintf (stderr, "usage: %s [-bV] device\n", program_name); exit (1); } @@ -166,17 +166,23 @@ void main (int argc, char ** argv) int big_endian; char c; + initialize_ext2_error_table(); fprintf (stderr, "dumpe2fs %s, %s for EXT2 FS %s, %s\n", E2FSPROGS_VERSION, E2FSPROGS_DATE, EXT2FS_VERSION, EXT2FS_DATE); if (argc && *argv) program_name = *argv; - while ((c = getopt (argc, argv, "b")) != EOF) { + while ((c = getopt (argc, argv, "bV")) != EOF) { switch (c) { case 'b': print_badblocks++; break; + case 'V': + /* Print version number and exit */ + fprintf(stderr, "\tUsing %s\n", + error_message(EXT2_ET_BASE)); + exit(0); default: usage (); } @@ -184,7 +190,6 @@ void main (int argc, char ** argv) if (optind > argc - 1) usage (); device_name = argv[optind++]; - initialize_ext2_error_table(); retval = ext2fs_open (device_name, 0, 0, 0, unix_io_manager, &fs); if (retval) { com_err (program_name, retval, "while trying to open %s", @@ -203,7 +208,7 @@ void main (int argc, char ** argv) ext2fs_close (fs); exit (1); } - big_endian = ((fs->flags & EXT2_SWAP_BYTES) != 0); + big_endian = ((fs->flags & EXT2_FLAG_SWAP_BYTES) != 0); if (!i386_byteorder()) big_endian = !big_endian; if (big_endian) |