1 |
commit: 520e5210196c081acee700cb1fcde0ad558b3ccb |
2 |
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 11 19:44:37 2017 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 12 08:50:00 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=520e5210 |
7 |
|
8 |
reformat usage text |
9 |
|
10 |
src/py/xml-rewrite-2.py | 25 +++++++++++++----------- |
11 |
src/py/xml-rewrite-3.py | 52 +++++++++++++++++++++---------------------------- |
12 |
2 files changed, 36 insertions(+), 41 deletions(-) |
13 |
|
14 |
diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py |
15 |
index 2b4702d..5c115eb 100755 |
16 |
--- a/src/py/xml-rewrite-2.py |
17 |
+++ b/src/py/xml-rewrite-2.py |
18 |
@@ -186,17 +186,20 @@ class SaxRewriter(XMLGenerator, StreamRewriterBase): |
19 |
|
20 |
def main(): |
21 |
usage = """Copyright 2004, 2006, 2007, 2017 Gentoo Foundation |
22 |
-Distributed under the terms of the GNU General Public Lincense v2 |
23 |
-Please contact the Gentoo Java Team <java@g.o> with problems. |
24 |
+Distributed under the terms of the GNU General Public Licence v2 |
25 |
+ |
26 |
+Reach out to the Gentoo Java Team <java@g.o> for questions/problems. |
27 |
+ |
28 |
Usage: |
29 |
- xml-rewrite.py [-f file] --delete [-g] -e tag [-e tag] -a attribute [-a attribute] [-i index] |
30 |
- xml-rewrite.py [-f file] --change [-g] -e tag [-e tag] -a attribute -v value [-a attribute -v value] |
31 |
- [--source-element tag] [--source-attribute attribute --source-value value] |
32 |
- [--target-element tag] [--target-attribute attribute --target-value value] [-i index] |
33 |
-Or: |
34 |
- xml-rewrite.py [-f file] -g |
35 |
- |
36 |
-If the -f parameter is not utilized, the script will read and |
37 |
+ xml-rewrite-2.py [-f file] --delete [-g] -e tag [-e tag] -a attribute [-a attribute] [-i index] |
38 |
+ xml-rewrite-2.py [-f file] --change [-g] -e tag [-e tag] -a attribute -v value [-a attribute -v value] |
39 |
+ xml-rewrite-2.py [-f file] -g |
40 |
+ |
41 |
+Additional parameters: |
42 |
+ [--source-element tag] [--source-attribute attribute --source-value value] |
43 |
+ [--target-element tag] [--target-attribute attribute --target-value value] [-i index] |
44 |
+ |
45 |
+If the -f parameter is not used, the script will read and |
46 |
write to stdin and stdout respectively. The use of quotes on |
47 |
parameters will break the script.""" |
48 |
|
49 |
@@ -371,4 +374,4 @@ parameters will break the script.""" |
50 |
|
51 |
|
52 |
if __name__ == '__main__': |
53 |
- main() |
54 |
\ No newline at end of file |
55 |
+ main() |
56 |
|
57 |
diff --git a/src/py/xml-rewrite-3.py b/src/py/xml-rewrite-3.py |
58 |
index b64ceda..04131e4 100755 |
59 |
--- a/src/py/xml-rewrite-3.py |
60 |
+++ b/src/py/xml-rewrite-3.py |
61 |
@@ -12,35 +12,27 @@ from javatoolkit.xml.SaxRewriter import SaxRewriter |
62 |
|
63 |
|
64 |
def main(): |
65 |
- usage = "XML Rewrite Python Module" |
66 |
- usage += "Copyright 2004,2006,2007 Gentoo Foundation\n" |
67 |
- usage += "Distributed under the terms of the GNU General Public Lincense v2\n" |
68 |
- usage += "Please contact the Gentoo Java Team <java@g.o> with problems.\n" |
69 |
- usage += "\n" |
70 |
- usage += "Usage:\n" |
71 |
- usage += " " + \ |
72 |
- sys.argv[0] + " [-f file] --delete [-g] -n tag [-n tag] -m attribute [-m attribute] [-i index]\n" |
73 |
- usage += " " + \ |
74 |
- sys.argv[0] + " [-f file] --change [-g] -e tag [-e tag] -a attribute -v value [-a attribute -v value] \\\n" |
75 |
- usage += " [--source-element tag] [--source-attribute attribute --source-value value] \\\n" |
76 |
- usage += " [--target-element tag] [--target-attribute attribute --target-value value] [-i index]\n" |
77 |
- usage += "Or:\n" |
78 |
- usage += " " + \ |
79 |
- sys.argv[0] + " [-f file] --javadoc --source-directory dir [--source-directory dir2] --output-directory dir3 \n" |
80 |
- usage += "Or:\n" |
81 |
- usage += " " + sys.argv[0] + " [-f file] -g\n" |
82 |
- usage += "\n" |
83 |
- usage += "Or:\n" |
84 |
- usage += " " + sys.argv[0] + " [-f file] --maven-cleaning\n" |
85 |
- usage += "\n" |
86 |
- usage += "Or for more detailed help:\n" |
87 |
- usage += " " + sys.argv[0] + " -h\n" |
88 |
- usage += "\n" |
89 |
- usage += "Multiple actions can be done simultaneously\n" |
90 |
- usage += "\n" |
91 |
- usage += "If the -f parameter is not utilized, the script will read and\n" |
92 |
- usage += "write to stdin and stdout respectively. The use of quotes on\n" |
93 |
- usage += "parameters will break the script.\n" |
94 |
+ usage = """Copyright 2004, 2006, 2007, 2017 Gentoo Foundation |
95 |
+Distributed under the terms of the GNU General Public Licence v2 |
96 |
+ |
97 |
+Reach out to the Gentoo Java Team <java@g.o> for questions/problems. |
98 |
+ |
99 |
+Usage: |
100 |
+ xml-rewrite-3.py [-f file] --delete [-g] -n tag [-n tag] -m attribute [-m attribute] [-i index] |
101 |
+ xml-rewrite-3.py [-f file] --change [-g] -e tag [-e tag] -a attribute -v value [-a attribute -v value] |
102 |
+ xml-rewrite-3.py [-f file] --javadoc --source-directory dir [--source-directory dir2] --output-directory dir3 |
103 |
+ xml-rewrite-3.py [-f file] --maven-cleaning |
104 |
+ xml-rewrite-3.py [-f file] -g |
105 |
+ |
106 |
+Additional parameters: |
107 |
+ [--source-element tag] [--source-attribute attribute --source-value value] |
108 |
+ [--target-element tag] [--target-attribute attribute --target-value value] [-i index] |
109 |
+ |
110 |
+Multiple actions can be done simultaneously. |
111 |
+ |
112 |
+If the -f parameter is not used, the script will read and |
113 |
+write to stdin and stdout respectively. The use of quotes on |
114 |
+parameters will break the script.""" |
115 |
|
116 |
def error(message): |
117 |
print("ERROR: " + message) |
118 |
@@ -245,7 +237,6 @@ def main(): |
119 |
action="append", |
120 |
dest="mavenMultiProjectsDirs", |
121 |
help="Dirs in classpath notation"), |
122 |
- |
123 |
make_option( |
124 |
"-t", |
125 |
"--source-attribute", |
126 |
@@ -265,6 +256,7 @@ def main(): |
127 |
dest="source_values", |
128 |
help="Value to set the attribute to. (sourceonly)") |
129 |
] |
130 |
+ |
131 |
parser = OptionParser(usage, options_list) |
132 |
(options, args) = parser.parse_args() |