Skip to content

Commit

Permalink
Add eatery point and __main__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahhhhmed committed Jun 27, 2017
1 parent 9918045 commit f7c905a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
14 changes: 14 additions & 0 deletions homotopy/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import argparse
import homotopy.parser


def main():
parser = argparse.ArgumentParser(description="Compile a snippet.")
parser.add_argument('snippet', nargs=1, type=str, help='a snippet to be compiled')

snippet = parser.parse_args().snippet[0]

print(homotopy.parser.parser.parse(snippet).compile())

if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@
description='snippet engine',
install_requires=[
'ply',
]
],
entry_points={
'console_scripts': [
'homotopy = homotopy.__main__:main'
]
}
)

0 comments on commit f7c905a

Please sign in to comment.