Commit 9090b09
committed
Quote arguments with whitespace when printing command
Currently, printing baked commands doesn't represent the way arguments
are actually passed down to the program when values contain spaces.
The solution is to take such values in single quotes.
This is primarily to be able to copy printed commands
and run them in a shell.
BEFORE:
```python
>>> from sh import ls
>>> print(ls.bake('How I Met Your Mother'))
/bin/ls How I Met Your Mother
```
AFTER:
```python
>>> print(ls.bake('How I Met Your Mother'))
/bin/ls 'How I Met Your Mother'
```1 parent 3bf6891 commit 9090b09
2 files changed
+30
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1391 | 1391 | | |
1392 | 1392 | | |
1393 | 1393 | | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
1398 | 1398 | | |
1399 | 1399 | | |
1400 | 1400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
858 | 864 | | |
859 | 865 | | |
860 | 866 | | |
| |||
2686 | 2692 | | |
2687 | 2693 | | |
2688 | 2694 | | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
2689 | 2715 | | |
2690 | 2716 | | |
2691 | 2717 | | |
| |||
0 commit comments