Skip to content
Permalink
Browse files

Add sorting code

  • Loading branch information...
PerilousApricot committed May 21, 2016
1 parent af00f9f commit 61f806ffc68c41dfbb926ea6825292eabed46966
Showing with 16 additions and 0 deletions.
  1. +16 −0 sort.py
16 sort.py
@@ -0,0 +1,16 @@
#!/usr/bin/env python

import re
import sys

sort = {}
regex = re.compile(r'TBX_API \w* \*?(\w*)\(.*')
for line in sys.stdin.readlines():
result = regex.match(line)
if not result:
sort[line] = line
else:
sort[result.group(1)] = line

for k in sorted(sort.keys()):
sys.stdout.write(sort[k])

0 comments on commit 61f806f

Please sign in to comment.
You can’t perform that action at this time.