1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
From: Cordell Bloor <cgmb@slerp.xyz>
Date: Fri, 18 Apr 2025 22:09:26 -0600
Subject: fix roc-obj help
Defining the appropriate Getopt::Std variables and functions prevents
the --help command from printing this sort of weird output:
/usr/bin/roc-obj-ls version [unknown] calling Getopt::Std::getopts (version 1.14 [paranoid]),
running under Perl version 5.40.1.
<...>
[Now continuing due to backward compatibility and excessive paranoia.
See 'perldoc Getopt::Std' about $Getopt::Std::STANDARD_HELP_VERSION.]
Forwarded: no
Bug-Debian: https://bugs.debian.org/1103558
---
hipamd/bin/roc-obj-extract | 10 ++++++++++
hipamd/bin/roc-obj-ls | 10 ++++++++++
2 files changed, 20 insertions(+)
--- a/hipamd/bin/roc-obj-extract
+++ b/hipamd/bin/roc-obj-extract
@@ -41,6 +41,16 @@
my $error=0;
my $output_to_stdout=0;
+$Getopt::Std::STANDARD_HELP_VERSION = 1;
+
+sub HELP_MESSAGE {
+ usage();
+}
+
+sub VERSION_MESSAGE {
+ print("roc-obj-extract " . `hipconfig --version` . "\n");
+}
+
sub usage {
print("Usage: $0 [-o|v|h] URI... \n");
print(" URIs can be read from STDIN, one per line.\n");
--- a/hipamd/bin/roc-obj-ls
+++ b/hipamd/bin/roc-obj-ls
@@ -28,6 +28,16 @@
use List::Util qw(max);
use URI::Escape;
+$Getopt::Std::STANDARD_HELP_VERSION = 1;
+
+sub HELP_MESSAGE {
+ usage();
+}
+
+sub VERSION_MESSAGE {
+ print("roc-obj-ls " . `hipconfig --version` . "\n");
+}
+
sub usage {
print("Usage: $0 [-v|h] executable...\n");
print("List the URIs of the code objects embedded in the specfied host executables.\n");
|