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

Stop escaping the default values of arguments/options when displaying help #65

Closed
pmav99 opened this issue Jan 9, 2019 · 0 comments · Fixed by #239
Closed

Stop escaping the default values of arguments/options when displaying help #65

pmav99 opened this issue Jan 9, 2019 · 0 comments · Fixed by #239

Comments

@pmav99
Copy link

pmav99 commented Jan 9, 2019

In the help message, the default values seem to be escaped which is probably misleading for the potential users. E.g., in the following example, the separator option defaults to \. Nevertheless, what is being displayed in the help message is:

OPTIONS
  -s (--separator)       The separator (default: "\\")

Notice the "\\"

Minimal Working example

from cleo import Application
from cleo import Command

class MyCommand(Command):
    """
    Command description

    cmd
        {--s|separator=\ : The separator}
    """
    def handle(self):
        separator = self.option("separator")
        print(separator)
        print(repr(separator))
        print(len(separator))
        print(type(separator))
        if separator == "\\":
            print("Yay!")

def main():
    application = Application()
    application.add(MyCommand())
    application.run()

if __name__ == "__main__":
    main()
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

Successfully merging a pull request may close this issue.

1 participant