click detects program name when run as module
This commit is contained in:
parent
64206c13c2
commit
055cdc2625
2 changed files with 4 additions and 4 deletions
|
|
@ -1,3 +1,3 @@
|
|||
from .cli import main
|
||||
|
||||
main(as_module=True)
|
||||
main()
|
||||
|
|
|
|||
|
|
@ -953,10 +953,10 @@ debug mode.
|
|||
)
|
||||
|
||||
|
||||
def main(as_module=False):
|
||||
def main():
|
||||
# TODO omit sys.argv once https://github.com/pallets/click/issues/536 is fixed
|
||||
cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
|
||||
cli.main(args=sys.argv[1:])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(as_module=True)
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue