726
|
1 #!/usr/bin/env python
|
|
2 # -*- coding: utf-8 -*-
|
|
3
|
|
4 """
|
|
5 find str format options
|
|
6 """
|
|
7
|
|
8 import argparse
|
|
9 import os
|
|
10 import subprocess
|
|
11 import sys
|
|
12
|
|
13 __all__ = ['main']
|
|
14
|
|
15 def find_keys(string):
|
|
16 retval = set()
|
|
17 while True:
|
|
18 try:
|
|
19 string.format(**{i:'' for i in retval})
|
|
20 return retval
|
727
|
21 except KeyError as e:
|
|
22 retval.add(e.message)
|
|
23
|
726
|
24
|
|
25 def main(args=sys.argv[1:]):
|
|
26
|
|
27 string = ' '.join(args)
|
727
|
28 keys = find_keys(string)
|
|
29 print ('\n'.join(sorted(keys)))
|
726
|
30
|
|
31 if __name__ == '__main__':
|
|
32 main()
|