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

support for -h raises an error #22

Open
sleepwalker2017 opened this issue Oct 8, 2022 · 0 comments
Open

support for -h raises an error #22

sleepwalker2017 opened this issue Oct 8, 2022 · 0 comments

Comments

@sleepwalker2017
Copy link

my code is like this.

@dataclass
class Person:
    name: str = 'John'
    age: int = 18

if __name__ == '__main__':
    import sys
    print(sys.argv)
    #main()
    parser = argparse.ArgumentParser()

    parser.add_argument('--config_path', type=str)
    parser.add_argument('hps', nargs=argparse.REMAINDER)
    args = parser.parse_args()
    print(args)
    cfg = pyrallis.parse(Person, config_path = args.config_path, args = args.hps[1:])
    print(cfg)

when I run python simple_test.py hps --help, it give right help messages.
but when I run python simple_test.py hps -h, it raise an exception.

Is this a bug?

image

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

1 participant