|
26 | 26 | {bold('Default Commands')}
|
27 | 27 | ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
28 | 28 |
|
29 |
| -Run shell commands by prefixing them with `!`. |
30 |
| -E.g. |
31 |
| - ./shell.py !echo abc; echo def # Bash |
32 |
| -
|
33 | 29 | Run multiple Python commands by separating each command with colons or newlines.
|
34 | 30 | E.g.
|
35 |
| - ./shell.py 'print abc; print def \n print ghi' |
| 31 | + ./shell.py 'print abc; print def' |
36 | 32 |
|
37 | 33 | {bold('Variables')}
|
38 | 34 | ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
57 | 53 | E.g.
|
58 | 54 | ```
|
59 | 55 | echo abc | ./shell.py print
|
60 |
| - ./shell.py print abc | echo |
61 |
| -``` |
62 |
| -
|
63 |
| -2. Within the dsl |
64 |
| -E.g. |
65 |
| -``` |
66 |
| - ./shell.py print abc # Python |
67 | 56 | ./shell.py 'print abc | echo'
|
68 |
| - ./shell.py 'print abc |> print' |
69 | 57 | ```
|
70 | 58 | """
|
71 | 59 |
|
@@ -121,7 +109,7 @@ def onecmd_inner(self, lines: str):
|
121 | 109 | def run_commands(self, ast: Node, prev_result='', run=False):
|
122 | 110 | if isinstance(ast, Term):
|
123 | 111 | return ast.run(prev_result, shell=self, lazy=not run)
|
124 |
| - # results = shell.run_commands(item, '', not lazy) |
| 112 | + # results = shell.run_commands(item, '', not lazy) |
125 | 113 |
|
126 | 114 | elif isinstance(ast, str):
|
127 | 115 | return self.run_commands(Term(ast), prev_result, run=run)
|
@@ -397,6 +385,7 @@ def setup(shell: Shell = None, functions: Dict[str, Function] = None, completion
|
397 | 385 | shell.load_session(io_util.parse_args.session)
|
398 | 386 |
|
399 | 387 | commands = ' '.join(io_util.parse_args.cmd + list(read_stdin()))
|
| 388 | + print('commands', commands) |
400 | 389 | filename = io_util.parse_args.file
|
401 | 390 |
|
402 | 391 | return shell, commands, filename
|
|
0 commit comments