Sorry, I just noticed this. The reason why I use `basename` on the program name (or argv[0]) is because argv[0] depends on where and how the program is called.
Code:
ie:
$ run_my_program (in $PATH) - argv[0] = "run_my_program"
$ ./run_my_program - argv[0] = "./run_my_program"
$ /home/user/run_my_program - argv[0] = "/home/user/run_my_program"
I don't care where the program resides, when error reporting. So I strip it first thing. It's just cleaner to my eyes. And like I said, this is all in a template, I never have to type anything other than my desire to use `program_name` when I need to.