Named after the famous Pulp Fiction boxer Butch Coolidge from Tennessee.
pip install butch
Make sure to run the test suite after the installation to verify everything
works as it should. The test suite is included in the package itself, so it
should be located in the first site-packages
folder found via site.getsitepackages()
.
python -m unittest discover \ $(python -c "import site;print(site.getsitepackages()[0])")/butch
Get the latest version:
pip install https://github.com/KeyWeeUsr/butch/zipball/master
Butch is available as a standalone executable as well as a Python module, therefore it can be invoked by any of these commands if installed properly:
butch python -m butch
which will launch the REPL (console) directly.
Use butch /C "echo Hello, Batch"
for interpreting a Batch command from a
string or use butch /C hello.bat
to run Batch from a file.
Use /K
switch instead of /C
to jump into the console after a command or
a file finishes.
Use butch /h
to display help for other switches.
[ ] ASSOC
[ ] CALL
[X] CD
pending:
- [ ]
/D
change current drive + path
- [ ]
[X] CHDIR
[X] CLS
[ ] COLOR
[ ] COPY
[X] DATE
pending:
- [ ] set the system date when called without arguments
[X] DEL
pending:
- [ ]
/F
force deleting of read-only files - [ ]
/S
delete specified files from all subdirectories - [ ]
/A
selects files to delete based on attributes
- [ ]
[X] DIR
pending:
- [ ] Volume drive lookup
- [ ] Volume label on drive
- [ ]
/A
- [ ]
/B
- [ ]
/C
- [ ]
/D
- [ ]
/L
- [ ]
/N
- [ ]
/O
- [ ]
/P
- [ ]
/Q
- [ ]
/S
- [ ]
/T
- [ ]
/W
- [ ]
/X
- [ ]
DIRCMD
env variable preset
[X] ECHO
[ ] ENDLOCAL
[X] ERASE
[X] EXIT
[ ] FOR
[ ] FTYPE
[X] GOTO
[ ] IF
[X] MD
[X] MKDIR
[ ] MKLINK
[ ] MOVE
[X] PATH
[X] PAUSE
[X] POPD
[X] PROMPT
[X] PUSHD
[X] RD
[X] REM
[ ] REN
[X] RMDIR
[/] SET
pending:
- [X] single value adding (
set x=123
) - [X] single value clearing (
set x=
) - [X] listing all stored variables (
set
) - [X]
/P
prompt for user input (set /P x=prompt
) - [ ] case-insensitive access, but case-sensitive output
- ...
- [X] single value adding (
[ ] SETLOCAL
[ ] SHIFT
[ ] START
[X] TIME
pending:
- [ ] set the system time when called without arguments
[X] TITLE
[X] TYPE
[X] VER
[ ] VERIFY
[ ] VOL
[X] ::
[ ] External commands
[ ] CLI prioritization of external commands
[X] Echo off (
@
)[X] Quotes (
"
)[X] Quotes (
"
) in words[ ] Conditions (
IF
,ELSE
)[ ] Caret escaping (
^
)[/] Code blocks (
(
,)
)pending:
- [ ] nested blocks
- [X] multi-line block
[X] Redirection to commands (
|
- pipes)pending:
- [ ]
RMDIR
command doesn't pull ctx.output and related parts - [ ] generic command I/O handling as a decorator/class?
- [ ]
[X] Output redirection (
>
,>>
)[X] Input redirection (
<
), e.g.:set /p key="prompt" < file
[ ] Redirection to special (
nul
)[ ] Joining streams (STDIN, STDOUT, STDERR, UNDEFINED (3-9)) (
2>&1
)[ ] Command concatenation (
&
)[ ] Command concatenation (
&&
)[ ] Command concatenation (
||
)[ ] Recognize Windows path separator in path input (
\
)
- [ ]
/?
as a proper help page trigger - [ ]
/T
for foreground/background colors - [ ]
/A
for printing only ANSI (which is most likely just 1252) - [ ]
/U
for printing Unicode (Unicode UCS-2 LE) - [ ]
/D
registry with autorun commands (.bashrc, kind of) + ignore - [ ]
/E:ON|OFF
,/X
,/Y
enable/disable command extensions - [ ]
/S
quote stripping from commands - [ ]
/V:ON|OFF
delayed expansion