Added reformat command to hm.py

This commit is contained in:
Nick Bolton 2009-12-27 20:12:41 +00:00
parent 7dd6671c13
commit 318980c26c

11
hm.py
View File

@ -51,6 +51,7 @@ commands = [
'revision',
'help',
'hammer',
'reformat',
'--help',
'-h',
'/?'
@ -130,6 +131,7 @@ def usage():
' package Create a distribution package (e.g. tar.gz)\n'
' install Installs the program\n'
' hammer Golden hammer (config, build, package)\n'
' reformat Reformat .cpp and .h files using AStyle\n'
' usage Shows the help screen\n'
'\n'
'Alias commands:\n'
@ -468,6 +470,8 @@ def main(argv):
setup()
elif cmd in ['hammer']:
hammer()
elif cmd in ['reformat']:
reformat()
else:
print 'Command not yet implemented:',cmd
@ -756,5 +760,12 @@ def hammer():
for pt in package_types:
package(pt)
def reformat():
# TODO: error handling
os.system(
r'tool\astyle\AStyle.exe '
'--quiet --suffix=none --style=java --indent=force-tab=4 --recursive '
'lib/*.cpp lib/*.h cmd/*.cpp cmd/*.h')
# Start the program.
main(sys.argv)