Package: patator / 0.7-2

Improve-usage-output-to-report-correct-executable-name.patch Patch series | download
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
From: Raphael Hertzog <hertzog@debian.org>
Date: Sat, 26 Aug 2017 13:33:47 +0200
Subject: Improve usage output to report correct executable name

When patator.py is installed as "patator" it now correctly displays
"patator".
---
 patator.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/patator.py	2018-08-03 15:28:55.986373034 +0800
+++ b/patator.py	2018-08-03 15:31:13.225019588 +0800
@@ -4869,10 +4869,13 @@
 
   def show_usage():
     print(__banner__)
-    print('''Usage: patator.py module --help
+    print('''Usage: %s module --help
 
 Available modules:
-%s''' % '\n'.join('  + %-13s : %s' % (k, v[1].__doc__) for k, v in modules))
+%s''' % (
+  os.path.basename(sys.argv[0]),
+  '\n'.join('  + %-13s : %s' % (k, v[1].__doc__) for k, v in modules)
+))
 
     sys.exit(2)