From cb6008c385cad6c7e0082d09e5b03b2d8aed17ca Mon Sep 17 00:00:00 2001 From: Luna Date: Thu, 6 Jun 2019 17:39:47 -0300 Subject: [PATCH] add basic argv read --- examples/hello.scri | 1 + scritcher/main.py | 11 ++++++++++- setup.py | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 examples/hello.scri diff --git a/examples/hello.scri b/examples/hello.scri new file mode 100644 index 0000000..e804f19 --- /dev/null +++ b/examples/hello.scri @@ -0,0 +1 @@ +noop diff --git a/scritcher/main.py b/scritcher/main.py index 654e2c7..f62051a 100644 --- a/scritcher/main.py +++ b/scritcher/main.py @@ -1,2 +1,11 @@ +import sys +from pathlib import Path + def main(): - print('hello world') + try: + scri_path = Path(sys.argv[1]).resolve() + except IndexError: + print(f'usage: {sys.argv[0]} path/to/file.scri') + return + print('path', scri_path) + #run(scri_path) diff --git a/setup.py b/setup.py index 69cb198..852efa9 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,9 @@ setup( name='scritcher', version='0.1', py_modules=['scritcher'], - install_requires=[], + install_requires=[ + 'Pillow==6.0.0', + ], entry_points=''' [console_scripts] scritcher=scritcher:main