Incidentally, this is how AmigaDOS handled it and applications were expected to call ReadArgs() to deal with it:
http://tbs-software.com/guide/index.php?guide=autodocs.doc%2Fdos.doc&node=105