2017-01-11 12:10:58 +00:00
|
|
|
import sys
|
|
|
|
|
2016-10-30 15:17:42 +02:00
|
|
|
|
|
|
|
def main(args=None):
|
|
|
|
if args is None:
|
|
|
|
args = sys.argv[1:]
|
|
|
|
|
2020-05-04 17:37:24 +01:00
|
|
|
# TODO Add help output, --help, etc.
|
|
|
|
|
2016-10-30 15:17:42 +02:00
|
|
|
# TODO Handle library-wide options. Eg.:
|
|
|
|
# --unicodedata
|
|
|
|
# --verbose / other logging stuff
|
|
|
|
|
|
|
|
# TODO Allow a way to run arbitrary modules? Useful for setting
|
|
|
|
# library-wide options and calling another library. Eg.:
|
|
|
|
#
|
|
|
|
# $ fonttools --unicodedata=... fontmake ...
|
|
|
|
#
|
|
|
|
# This allows for a git-like command where thirdparty commands
|
|
|
|
# can be added. Should we just try importing the fonttools
|
|
|
|
# module first and try without if it fails?
|
|
|
|
|
|
|
|
mod = 'fontTools.'+sys.argv[1]
|
|
|
|
sys.argv[1] = sys.argv[0] + ' ' + sys.argv[1]
|
|
|
|
del sys.argv[0]
|
|
|
|
|
|
|
|
import runpy
|
|
|
|
runpy.run_module(mod, run_name='__main__')
|
|
|
|
|
2017-01-11 12:10:58 +00:00
|
|
|
|
2016-10-30 15:17:42 +02:00
|
|
|
if __name__ == '__main__':
|
2017-01-11 12:10:58 +00:00
|
|
|
sys.exit(main())
|