jhallen / cpm

Run CP/M commands in Linux/Cygwin with this Z80 / BDOS / ADM-3A emulator.
Other
108 stars 26 forks source link

Added --exec option and implemented single command execution #9

Closed algodesigner closed 5 years ago

algodesigner commented 5 years ago

I was very pleased with your implementation of CP/M container and how naturally it fits into a command line environment. Well done!

This pull requests adds a command line option "--exec" that causes the application to run a single command, if provided, and exit.

The newly introduced functionality makes it somewhat easier to integrate cpm is the cross-platform (retro) development environments (be they IDE-based or vim) in which the sources are edited and kept in a version control system outside, but the compilers are run within the CP/M container.

Please note, that with the introduction of the new option, the "command" token remains optional, meaning that ./cpm --exec is effectively a no-op call that is similar to ./cpm bye. I decided against putting an error check in main.c against this combination for now.

I have made an effort to reduce the changes to the bare minimum.

Sample commands: cpm --exec dir cpm --exec gen80 hello.gen

jhallen commented 5 years ago

Thanks, I merged it.

algodesigner commented 5 years ago

Thank you for merging in the change!