erg/crates/erg_compiler/lib/pystd/argparse.d.er
2023-01-15 12:03:19 +09:00

14 lines
492 B
Python

._StoreAction: ClassType
.ArgumentParser!: ClassType
.new = 'ArgumentParser': (description := Str, prog := Str) -> .ArgumentParser!
.ArgumentParser!.add_argument!: (
name: Str, # TODO: var-args
action := Str or NoneType,
default := Obj or NoneType,
type := Type,
required := Bool,
help := Str or NoneType,
choices := Obj or NoneType,
) => ._StoreAction
.ArgumentParser!.parse_args!: (args := Str or [Str; _] or NoneType,) => Obj # TODO: type with dependent types