[Chapel Merge] Fix mentions of internal shadow environment variab

Branch: refs/heads/main
Revision: ef58278
Author: bradcray
Link: Fix mentions of internal shadow environment variables in --help-env output by bradcray · Pull Request #18950 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #18950 from bradcray/fix-underscore-help-env

Fix mentions of internal shadow environment variables in --help-env output

[reviewed by @ben-albrecht ]

While answering a question for Andy, I learned/remembered that in PR #2919, shadow variables
for the standard CHPL_ environment variables were introduced, differentiated by a leading
underscore (e.g., _CHPL_COMM rather than CHPL_COMM). I hadn't noticed before now,
but it seems that these internal variables are revealed in our --help-env output, where we
should put the user versions of the variables instead. This PR adds a special case to --help-env
to drop leading underscores when present.

We didn't catch this earlier because we don't have a test for --help-env—the reason being
that maintaining the tests of --help have traditionally caused maintenance gripes, so I think
we shied away from adding another test for --help-env. I still feel OK about that decision,
just noting it here for posterity.

Modified Files:
M compiler/main/arg.cpp

Compare: https://github.com/chapel-lang/chapel/compare/077e1e28aa1c...ef58278349e9