Shell utilities¶
The module msp430.shell provides some useful scripts for the shell.
msp430.shell.command¶
This tool emulates a number of shell utilities. The idea is that makefiles or similar build tools can use these commands to be OS independent (so that the same set of commands works on Windows, MacOS, GNU/Linux, etc.).
Command collection:
catShow file contents.cpCopy files.expandExpand shell patterns (“*.c”, “?” etc.).falseSimply return exit code 1listThis text.mkdirCreate directories.mvMove/rename files.rmDelete files/directories.touchUpdate file date, create file.trueSimply return exit code 0
More help with “command.py COMMAND –help”
Example:
python -m msp430.shell.command rm -f no_longer_needed.txt
python -m msp430.shell.command cp src.txt dst.txt
msp430.shell.watch¶
This tool watches one or multiple files for changes. When a change on one file is detected it runs a given command. This could be used e.g. to automatically trigger a download when a hex file has changed or trigger compilation when one of the source files has changed.
Usage: watch.py FILENAME [FILENAME…] –execute “some/program/ –”
- Options:
-h, --help show this help message and exit -x COMMAND, --execute=COMMAND run this command when watched file(s) changed, – is replaced by FILENAME(s)