|
1 | 1 | from sys import exit |
2 | 2 | import platform |
| 3 | +from .update import VERSION, update |
3 | 4 |
|
4 | | -VERSION = '0.1.1' |
5 | 5 | PLATFORM = f'[ {platform.python_implementation()} {platform.python_version()} ] on {platform.system()}' |
6 | 6 |
|
7 | 7 | options_dict = { |
@@ -75,12 +75,17 @@ def show_keywords(): |
75 | 75 | def remove_error(): |
76 | 76 | options_dict['show_error'] = False |
77 | 77 |
|
| 78 | +def update_version(): |
| 79 | + update() |
| 80 | + quit(0) |
| 81 | + |
78 | 82 | arguments = [ # 输入参数: (参数简写, 参数全称, 运行函数, 描述) |
79 | 83 | ('-gt', '--get-tree', get_tree, 'To show the tree of the program after being parsed'), |
80 | 84 | ('-v', '--version', version, 'To show the version of this interpreter'), |
81 | 85 | ('-h', '--help', help, 'To show this help page'), |
82 | 86 | ('-p', '--parse', open_parse_info, 'To show parse information during running'), |
83 | 87 | ('-t', '--time', get_time, 'To show the time for the script to run'), |
84 | 88 | ('-k', '--keywords', show_keywords, 'To show all the keywords'), |
85 | | - ('-ne', '--no-error', remove_error, 'To remove all error messages') |
| 89 | + ('-ne', '--no-error', remove_error, 'To remove all error messages'), |
| 90 | + ('-u', '--update', update_version, 'To check or update the version (only work if you are installing with git)') |
86 | 91 | ] |
0 commit comments