|
@@ -88,8 +88,25 @@ mktemplate() {
|
88
|
88
|
py3|Python3)
|
89
|
89
|
echo "#!/usr/bin/python3"
|
90
|
90
|
echo ''
|
91
|
|
- echo "if __name__ == '__main__':"
|
92
|
|
- echo ' '
|
|
91
|
+ echo 'import sys'
|
|
92
|
+ echo ''
|
|
93
|
+ echo ''
|
|
94
|
+ echo 'class UsageError(ValueError):'
|
|
95
|
+ echo ' pass'
|
|
96
|
+ echo ''
|
|
97
|
+ echo ''
|
|
98
|
+ echo 'def usage():'
|
|
99
|
+ echo ' self = sys.argv[0]'
|
|
100
|
+ echo ' raise UsageError("usage: %s [-j|-t|-p] YAML_FILE.." % self)'
|
|
101
|
+ echo ''
|
|
102
|
+ echo ''
|
|
103
|
+ echo 'def main(argv):'
|
|
104
|
+ echo ' if len(argv) < 2:'
|
|
105
|
+ echo ' usage()'
|
|
106
|
+ echo ''
|
|
107
|
+ echo ''
|
|
108
|
+ echo 'if __name__ == "__main__":'
|
|
109
|
+ echo ' main(sys.argv[1:])'
|
93
|
110
|
;;
|
94
|
111
|
|
95
|
112
|
pya)
|