Se ho capito bene quello che vuoi fare ti basta guardare nell'array argv[]...