OSDN Git Service

Merge branch 'master' of git.osdn.net:/gitroot/joypy/Thun
[joypy/Thun.git] / joy / __main__.py
1 # -*- coding: utf-8 -*-
2 #
3 #    Copyright © 2014, 2015, 2017 Simon Forman
4 #
5 #    This file is part of Thun
6 #
7 #    Thun is free software: you can redistribute it and/or modify
8 #    it under the terms of the GNU General Public License as published by
9 #    the Free Software Foundation, either version 3 of the License, or
10 #    (at your option) any later version.
11 #
12 #    Thun is distributed in the hope that it will be useful,
13 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #    GNU General Public License for more details.
16 #
17 #    You should have received a copy of the GNU General Public License
18 #    along with Thun.  If not see <http://www.gnu.org/licenses/>.
19 #
20 import sys
21 from .library import initialize, inscribe
22 from .joy import repl, interp
23 from .utils.pretty_print import trace
24
25
26 inscribe(trace)
27
28 if '-q' in sys.argv:
29     j = interp
30 else:
31     j = repl
32     print('''\
33 Thun - Copyright © 2017 Simon Forman
34 This program comes with ABSOLUTELY NO WARRANTY; for details type "warranty".
35 This is free software, and you are welcome to redistribute it
36 under certain conditions; type "sharing" for details.
37 Type "words" to see a list of all words, and "[<name>] help" to print the
38 docs for a word.
39 ''')
40 stack = j(dictionary=initialize())