"the files given to the program are expanded" – What do you mean exactly? If you mean globs like
*.txt then they are not given to the program in the first place. The shell expands them before running the program and only the shell knows the original command line. What is your shell?