Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help() procedure only takes a constant string #75

Open
not-lum opened this issue Feb 14, 2022 · 2 comments
Open

help() procedure only takes a constant string #75

not-lum opened this issue Feb 14, 2022 · 2 comments

Comments

@not-lum
Copy link

not-lum commented Feb 14, 2022

help() procedure only takes a constant string, but what if I want to change help text depending on the situation? Example:

var helpText = "..."

if not trueColorSupport:
  helpText &= "\nWARNING: your terminal emulator does not support true colors"

var parser = newParser:
  help(helpText)
  ...
@iffy
Copy link
Owner

iffy commented Feb 14, 2022

Since the parser is generated at compile-time, if you're able to build up the string during compile time, it will work. I can see the value in what you're asking though. Perhaps help() could be made to also accept a zero-argument function.

@levovix0
Copy link

This will also be useful for localizing help messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants