mirror of
https://github.com/httpie/cli.git
synced 2024-11-28 08:38:44 +02:00
4ff22defe4
It also simplifies how the `main()` function could be tested.
20 lines
394 B
Python
20 lines
394 B
Python
"""The main entry point. Invoke as `http' or `python -m httpie'.
|
|
|
|
"""
|
|
|
|
|
|
def main():
|
|
try:
|
|
from httpie.core import main
|
|
exit_status = main()
|
|
except KeyboardInterrupt:
|
|
from httpie.status import ExitStatus
|
|
exit_status = ExitStatus.ERROR_CTRL_C
|
|
|
|
return exit_status.value
|
|
|
|
|
|
if __name__ == '__main__': # pragma: nocover
|
|
import sys
|
|
sys.exit(main())
|