More verbose output for -ver

Started by obetz, February 17, 2020, 02:03:25 AM

Previous topic - Next topic

obetz

Hi Phil,

the following patch is rather useful to investigate subtleties of the Windows environment. Try it with the PAR packed version an be surprised. Maybe you want to incorporate it in the standard distribution:


@@ -683,6 +684,13 @@
             print "ExifTool version $version$str$Image::ExifTool::RELEASE\n";
             printf "Perl version %s%s\n", $], (defined ${^UNICODE} ? " (-C${^UNICODE})" : '');
             print "Platform: $^O\n";
+ # Patch by Oliver Betz for more verbose output
+            if ($verbose > 8) {
+                print "Current dir:    " . Cwd::getcwd() . "\n" if (eval { require Cwd });
+                print "Script name \$0: $0\n";
+                print "\$exeDir:        $exeDir\n";
+                print "Exe name \$^X:   $^X\n";
+            }
             print "Optional libraries:\n";
             foreach (@recommends) {
                 next if /^Win32/ and $^O ne 'MSWin32';


Oliver

Phil Harvey

Thanks.  I'll give it a try.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

obetz

Extended now to:


            if ($verbose > 8) {
                print "Current dir:    " . Cwd::getcwd() . "\n" if (eval { require Cwd });
                print "Script name \$0: $0\n";
                print "Exe name \$^X:   $^X\n";
                print "\$exeDir:        $exeDir\n";
                print "exePath:        $Image::ExifTool::exePath\n";
            }