Git Product home page Git Product logo

Comments (7)

mppf avatar mppf commented on May 18, 2024

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.

bradcray avatar bradcray commented on May 18, 2024

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.

arezaii avatar arezaii commented on May 18, 2024

With the addition of the ArgumentParser module in v1.25, do we still want to try to support this behavior?

from chapel.

bradcray avatar bradcray commented on May 18, 2024

@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.

arezaii avatar arezaii commented on May 18, 2024

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.

bradcray avatar bradcray commented on May 18, 2024

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.

mppf avatar mppf commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.