How does one say that their C program should accept a file list?
For example my program blah should accept hello.txt by the following call in the console:
blah hello.txt
I am not sure how to parse an argument and label it as a filepath (getopt doesn’t talk about this).
getopt()permutesargv[]so that all the non-options are shuffled to the end, so you simply callgetopt()to parse all the options and then loop throughargv[optind]up toargv[argc]. Those should be your file names, of course you need to check that those files actually exist, etc. C has no primitives for files. Here is some documentation about getopt().