Skip to content

Commit 60ac555

Browse files
committed
log
1 parent aaa0374 commit 60ac555

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

src/mash/io_util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,12 @@ def check_output(line: str) -> str:
208208
"""Similar to subprocess.check_output, but with more detailed error messages
209209
"""
210210
result = subprocess.run(line, capture_output=True, shell=True)
211+
stdout = result.stdout.decode()
211212

212-
msg = result.stdout.decode(), result.stderr.decode()
213+
msg = stdout, result.stderr.decode()
213214
assert result.returncode == 0, msg
214215

215-
return result.stdout.decode().rstrip('\n')
216+
return stdout.rstrip('\n')
216217

217218

218219
@functools.lru_cache(maxsize=64)

src/mash/shell/shell.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@
2626
{bold('Default Commands')}
2727
~~~~~~~~~~~~~~~~~~~~~~~~~~
2828
29-
Run shell commands by prefixing them with `!`.
30-
E.g.
31-
./shell.py !echo abc; echo def # Bash
32-
3329
Run multiple Python commands by separating each command with colons or newlines.
3430
E.g.
35-
./shell.py 'print abc; print def \n print ghi'
31+
./shell.py 'print abc; print def'
3632
3733
{bold('Variables')}
3834
~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -57,15 +53,7 @@
5753
E.g.
5854
```
5955
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
6756
./shell.py 'print abc | echo'
68-
./shell.py 'print abc |> print'
6957
```
7058
"""
7159

@@ -121,7 +109,7 @@ def onecmd_inner(self, lines: str):
121109
def run_commands(self, ast: Node, prev_result='', run=False):
122110
if isinstance(ast, Term):
123111
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)
125113

126114
elif isinstance(ast, str):
127115
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
397385
shell.load_session(io_util.parse_args.session)
398386

399387
commands = ' '.join(io_util.parse_args.cmd + list(read_stdin()))
388+
print('commands', commands)
400389
filename = io_util.parse_args.file
401390

402391
return shell, commands, filename

0 commit comments

Comments
 (0)