mirror of
https://github.com/debauchee/barrier.git
synced 2025-07-31 23:29:19 +02:00
Added reformat command to hm.py
This commit is contained in:
parent
7dd6671c13
commit
318980c26c
1 changed files with 11 additions and 0 deletions
11
hm.py
11
hm.py
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue