Init cli submodule

This commit is contained in:
Tim Van Baak 2023-05-29 12:56:25 -07:00
parent e8323bd981
commit c86aaca2b6
2 changed files with 14 additions and 1 deletions

View File

@ -1 +1,3 @@
print("hello world")
from .cli import main
main()

11
intake/cli.py Normal file
View File

@ -0,0 +1,11 @@
import os
import sys
def main():
try:
print("Hello, world!")
except BrokenPipeError:
# See https://docs.python.org/3.10/library/signal.html#note-on-sigpipe
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, sys.stdout.fileno())
sys.exit(1)