pyscripts: return error codes
This commit is contained in:
1 parent
8e29559db6
commit
00a4895440
3 files changed
+4
-4
No files matched your search
@@ -23,4 +23,4 @@ def main(argv):
|
|||||||
file_out.write(data)
|
file_out.write(data)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main(sys.argv)
|
sys.exit(main(sys.argv))
|
||||||
@@ -25,4 +25,4 @@ def main(argv):
|
|||||||
file_out.write("\n")
|
file_out.write("\n")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main(sys.argv)
|
sys.exit(main(sys.argv))
|
||||||
@@ -38,7 +38,7 @@ def main():
|
|||||||
Should produce the output:
|
Should produce the output:
|
||||||
|
|
||||||
\tTarget (BA) requires final LRC XOR byte value: 5A\n""".format(sys.argv[0]))
|
\tTarget (BA) requires final LRC XOR byte value: 5A\n""".format(sys.argv[0]))
|
||||||
return 0
|
return 1
|
||||||
|
|
||||||
target= int(sys.argv[len(sys.argv) - 1],16)
|
target= int(sys.argv[len(sys.argv) - 1],16)
|
||||||
|
|
||||||
@@ -48,4 +48,4 @@ def main():
|
|||||||
print('\nTarget (%02X) requires final LRC XOR byte value: %02X\n' % (target,lrc))
|
print('\nTarget (%02X) requires final LRC XOR byte value: %02X\n' % (target,lrc))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
sys.exit(main())
|
||||||
Reference in new issue
Block a user