Comments (7)
It seems odd that the example has an 'if false' - is that and error in the example? I suppose that either way you see the compiler-generated help.
Anyway a good example of user-overriding confit help should also call Help.printUsage() (from the Help standard module).
from chapel.
Oops, I think what happened was that I changed the test to 'true' to verify the .good file and then switched it to 'false' instead of 'help' when setting it back again.
I'm not sure I agree that good examples of providing custom help should necessarily call Help.printUsage()... I.e., maybe that's not what they would want the help message to look like.
from chapel.
With the addition of the ArgumentParser
module in v1.25, do we still want to try to support this behavior?
from chapel.
@arezaii : I'm not seeing how the addition of ArgumentParser
changes the root issue here (that defining a config
whose name happens to match a built-in flag silently loses to that flag). Does it?
from chapel.
No, you're right, it doesn't address this issue where a config
shadows a built-in. I was imagining the user could handle the --help
flag with the ArgumentParser
instead of a config
.
Do you envision a fix for this to handle just the --help
flag, or all/any Chapel defined flags, or maybe some other subset of flags?
from chapel.
I don't have a specific fix in mind, but I think the current behavior could potentially be pretty confusing to a user. I think with this specific case, it's easy to say "Well, the user should just use one of the other help capabilities that we support to get the help message they want", but I think the larger issue is that they may be using a config named help
to do something other than print out help / may not know about those features / may run into this with other similar flags.
So a very simple short-term fix would be to generate a warning for such configs indicating that they're shadowed by other built-in flags and that the user will have to use -s
or a fully-qualified --moduleName.help=
flag to set them (or should rename the variable to avoid the shadowing).
Longer-term, this relates to the discussion we've been having about the interaction between built-in flags (whether for built-in configs or other features) and arguments sent to main().
from chapel.
Longer-term, this relates to the discussion we've been having about the interaction between built-in flags (whether for built-in configs or other features) and arguments sent to main().
@arezaii - I'm not finding a public issue about this topic specifically. I know we had some discussion in https://github.com/Cray/chapel-private/issues/2289 though. Would you be able to open a public issue asking how built-in flags should interact with arguments sent to main?
from chapel.
Related Issues (20)
- [Bug]: mason `add` requires manual clone of registry
- [Bug]: 'mason publish' fails to add tags for remote package repo HOT 2
- [Bug]: Hexadecimal Floating Point Output Format HOT 14
- [Feature Request]: should `mason doc` add `/doc` to .gitignore HOT 1
- [Feature Request]: Allow anonymization of the output when calling `chpl --print-chpl-settings` and friends? HOT 1
- Proposal: Disallow spaces after @ for attributes HOT 6
- [Bug]: building chapel-py-venv removes sphinx-build binary HOT 5
- [Bug]: internal error calling promoted function with default values and actual reordering
- [Bug]:Ternary Operator in return statement causes (subsequent) stack corruption HOT 14
- [Bug]: Ignoring the return value of a type function results in a compiler segfault
- [Bug]: Reductions over distributed arrays in default arguments cause compiler segfaults HOT 1
- [Feature Request]: show instantiations for records/classes as well functions in CLS
- [Feature Request]: show defaulted parts of types in CLS type hints
- dyno: odd issue when calling `init` without `this`
- [Bug]: Error compiling Chapel-Py HOT 3
- [Bug?]: Inconsistency with c_array documentation and c_array behavior w.r.t. coercion to c_ptr HOT 1
- `source` field required in `Mason.toml` for registration, misleading documentation HOT 2
- should `checkModule` in `masonPublish` only count files? HOT 2
- [Bug]: Forwarding to a badly formatted `var` declaration causes an internal error
- [Bug]: `mason new` does not start an interactive session HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chapel.