This particular feature doesn't merit a write-up due to its simplicity, it's achieved by the following:
- When application is built a null byte (0x00) is written to the end of the executable
- When the application is run it opens its own executable and scans for the last null byte in the file. If there is anything after the last null byte it's assumed to be a program and is read in, otherwise the files listed by the commandline arguments are read
This exact approach only works with text as we're assured the file we're appending to the executable won't contain a null byte of its own