diff --git a/doc_src/photorec.1.in b/doc_src/photorec.1.in index 8119cc90..f9edc861 100644 --- a/doc_src/photorec.1.in +++ b/doc_src/photorec.1.in @@ -4,6 +4,8 @@ photorec \- Recover lost files from harddisk, digital camera and cdrom .SH SYNOPSIS .BI "photorec [/log] [/debug] [/d recup_dir] [device|image.dd|image.e01] +.sp +.BI "photorec /version .SH DESCRIPTION \fBPhotoRec\fP is file data recovery software designed to recover lost files including video, documents and archives from Hard Disks and CDRom and lost pictures (Photo Recovery) from digital camera memory. PhotoRec ignores the filesystem and goes after the underlying data, so it'll work even if your media's filesystem is severely damaged or formatted. PhotoRec is safe to use, it will never attempt to write to the drive or memory support you are about to recover lost data from. .SH OPTIONS diff --git a/doc_src/testdisk.1.in b/doc_src/testdisk.1.in index 71bdcb00..bdc3aba1 100644 --- a/doc_src/testdisk.1.in +++ b/doc_src/testdisk.1.in @@ -3,7 +3,9 @@ .SH NAME testdisk \- Scan and repair disk partitions .SH SYNOPSIS -.BI "testdisk [/log] [/debug] [/dump] +.BI "testdisk [/log] [/debug] [/dump] [device|image.dd|image.e01] +.sp +.BI "testdisk /version .sp .BI "testdisk /list [/log] .SH DESCRIPTION diff --git a/src/photorec.c b/src/photorec.c index 3e6bdc78..0ccfa99e 100644 --- a/src/photorec.c +++ b/src/photorec.c @@ -782,7 +782,7 @@ int main( int argc, char **argv ) { int i; int use_sudo=0; - int help=0, verbose=0; + int help=0, version=0, verbose=0; int create_log=TD_LOG_NONE; int run_setlocale=1; int testdisk_mode=TESTDISK_O_RDONLY|TESTDISK_O_READAHEAD_32K; @@ -988,6 +988,9 @@ int main( int argc, char **argv ) else if((strcmp(argv[i],"/help")==0) || (strcmp(argv[i],"-help")==0) || (strcmp(argv[i],"--help")==0) || (strcmp(argv[i],"/h")==0) || (strcmp(argv[i],"-h")==0)) help=1; + else if((strcmp(argv[i],"/version")==0) || (strcmp(argv[i],"-version")==0) || (strcmp(argv[i],"--version")==0) || + (strcmp(argv[i],"/v")==0) || (strcmp(argv[i],"-v")==0)) + version=1; else if((strcmp(argv[i],"/nosetlocale")==0) || (strcmp(argv[i],"-nosetlocale")==0)) run_setlocale=0; else if(strcmp(argv[i],"/cmd")==0) @@ -1022,9 +1025,30 @@ int main( int argc, char **argv ) list_disk=insert_new_disk(list_disk,disk_car); } } + if(version!=0) + { + printf("\n"); + printf("Version: %s\n", VERSION); + printf("Compiler: %s\n", get_compiler()); + printf("ext2fs lib: %s, ntfs lib: %s, ewf lib: %s, libjpeg: ", + td_ext2fs_version(), td_ntfs_version(), td_ewf_version()); +#if defined(HAVE_LIBJPEG) +#if defined(JPEG_LIB_VERSION) + printf("%u", JPEG_LIB_VERSION); +#else + printf("yes"); +#endif +#else + printf("none"); +#endif + printf("\n"); + printf("OS: %s\n" , get_os()); + return 0; + } if(help!=0) { - printf("\nUsage: photorec [/log] [/debug] [/d recup_dir] [file or device]\n"\ + printf("\nUsage: photorec [/log] [/debug] [/d recup_dir] [file.dd|file.e01|device]\n"\ + " photorec /version\n" \ "\n" \ "/log : create a photorec.log file\n" \ "/debug : add debug information\n" \ diff --git a/src/testdisk.c b/src/testdisk.c index cb35a307..96c1960c 100644 --- a/src/testdisk.c +++ b/src/testdisk.c @@ -95,7 +95,7 @@ int main( int argc, char **argv ) { int i; int use_sudo=0; - int help=0, verbose=0, dump_ind=0; + int help=0, version=0, verbose=0, dump_ind=0; int create_log=TD_LOG_NONE; int do_list=0; int unit=UNIT_DEFAULT; @@ -157,6 +157,9 @@ int main( int argc, char **argv ) else if((strcmp(argv[i],"/help")==0) || (strcmp(argv[i],"-help")==0) || (strcmp(argv[i],"--help")==0) || (strcmp(argv[i],"/h")==0) || (strcmp(argv[i],"-h")==0)) help=1; + else if((strcmp(argv[i],"/version")==0) || (strcmp(argv[i],"-version")==0) || (strcmp(argv[i],"--version")==0) || + (strcmp(argv[i],"/v")==0) || (strcmp(argv[i],"-v")==0)) + version=1; else if(strcmp(argv[i],"/list")==0 || strcmp(argv[i],"-list")==0 || strcmp(argv[i],"-l")==0) { do_list=1; @@ -203,11 +206,22 @@ int main( int argc, char **argv ) list_disk=insert_new_disk(list_disk,disk_car); } } + if(version!=0) + { + printf("\n"); + printf("Version: %s\n", VERSION); + printf("Compiler: %s\n", get_compiler()); + printf("ext2fs lib: %s, ntfs lib: %s, reiserfs lib: %s, ewf lib: %s\n", + td_ext2fs_version(), td_ntfs_version(), td_reiserfs_version(), td_ewf_version()); + printf("OS: %s\n" , get_os()); + return 0; + } if(help!=0) { printf("\n" \ - "Usage: testdisk [/log] [/debug] [file or device]\n"\ - " testdisk /list [/log] [file or device]\n" \ + "Usage: testdisk [/log] [/debug] [file.dd|file.e01|device]\n"\ + " testdisk /list [/log] [file.dd|file.e01|device]\n" \ + " testdisk /version\n" \ "\n" \ "/log : create a testdisk.log file\n" \ "/debug : add debug information\n" \