which is pretty horrendous to look at. Should my derivation patch this “usage” line and replace #{$PROGRAM_NAME} with some hard-coded value? I don’t know what the community’s standards are in this area.
Yes, I am using wrapProgram. (It’s makeWrapper, not wrapProgram, that has the --argv0 flag—wrapProgram comes up with the argv0 value for you.) Even if I switch to using makeWrapper manually and provide an --argv0 value, though, the wrapped program’s name still shows up in the output:
The wrapper created by wrapProgram calls the underlying program with its full path (of course) but uses exec -a <wrappername> to try to change the argv0 value that the underlying program sees. Unfortunately, it seems like Ruby defeats this somehow and so the wrapped program can only see the full path. (This answer on Stack Overflow does some investigation into why this is.)
All told, it seems like I would need to patch $PROGRAM_NAME to a hard-coded value in the Ruby source if I wanted a nicer display name. I don’t know whether this kind of code change for cosmetic reasons is considered a good idea.
Thank you both for the responses! I’ve decided to go ahead and leave the program name as-is, which has the nice bonus that I don’t need to patch the Gem’s source at all.