The free Batch interpreter
Project description
Named after the famous Pulp Fiction boxer Butch Coolidge from Tennessee.
How to run
Installation
pip install butch
Post-Installation
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 $(python -c "import site;print(site.getsitepackages()[0])")/butch/test.py
Development
Get the latest version:
pip install https://github.com/KeyWeeUsr/butch/zipball/master
Running
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.
Features
Commands
[ ] ASSOC
[ ] CALL
[X] CD
pending:
[ ] /D change current drive + path
[X] CHDIR
[ ] CLS
[ ] COLOR
[ ] COPY
[ ] DATE
[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
[ ] FOR
[ ] FOR
[ ] FTYPE
[ ] GOTO
[ ] IF
[X] MD
[X] MKDIR
[ ] MKLINK
[ ] MOVE
[ ] PATH
[X] PAUSE
[ ] POPD
[X] PROMPT
[ ] PUSHD
[ ] RD
[ ] REM
[ ] REN
[ ] RMDIR
[ ] SET
pending: pretty much everything except the basic value add + clear
[ ] case-insensitive access, but case-sensitive output
[ ] SETLOCAL
[ ] SHIFT
[ ] START
[ ] TIME
[X] TITLE
[ ] TYPE
[ ] VER
[ ] VERIFY
[ ] VOL
[ ] ::
[ ] External commands
[ ] CLI prioritization of external commands
Syntax
[X] Echo off (@)
[X] Quotes (")
[X] Quotes (") in words
[ ] Conditions (IF, ELSE)
[ ] Caret escaping (^)
[ ] Code blocks ((, ))
[ ] Code blocks (multi-line block with (, ))
[X] Redirection to commands (| - pipes)
pending:
[ ] some individual commands don’t pull ctx.output and related parts
[ ] generic command I/O handling as a decorator/class?
[ ] Redirection to files (<, <<, >>, >)
[ ] Redirection to special (nul)
[ ] Command concatenation (&)
[ ] Command concatenation (&&)
[ ] Command concatenation (||)
[ ] Recognize Windows path separator in path input (\)
Console
[ ] /? 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
TODO
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.