]> git.armaanb.net Git - lightcards.git/commitdiff
Update installation
authorArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 03:21:37 +0000 (22:21 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 03:21:53 +0000 (22:21 -0500)
Add Makefile shell script, and __main__.py

Makefile [new file with mode: 0644]
README.md
lightcards.sh [new file with mode: 0755]
lightcards/__main__.py [new file with mode: 0644]
lightcards/lightcards.py

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..b0b7362
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+.DEFAULT_GOAL := install
+
+install:
+       pip install .
+       cp ./lightcards.sh /usr/local/bin/lightcards
index 560b692421f5d28955457c788417a5fb1e7b9e69..88c6d73d4063de9e87d4d8c6579b25c3fdc44940 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
 Lightcards is a terminal program for using flashcards from a Markdown or HTML table. Currently under development.
 
 # Installation
 Lightcards is a terminal program for using flashcards from a Markdown or HTML table. Currently under development.
 
 # Installation
-`pip install .`
+`make`
 
 ## License
 Copyright Armaan Bhojwani 2021, MIT license
 
 ## License
 Copyright Armaan Bhojwani 2021, MIT license
diff --git a/lightcards.sh b/lightcards.sh
new file mode 100755 (executable)
index 0000000..10a1657
--- /dev/null
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+python3 -m lightcards ${@}
diff --git a/lightcards/__main__.py b/lightcards/__main__.py
new file mode 100644 (file)
index 0000000..283493d
--- /dev/null
@@ -0,0 +1,4 @@
+import sys
+import lightcards.lightcards
+
+lightcards.lightcards.main(sys.argv)
index 775b13d24afaea722dc63296ef995e366a16c794..62019a52b6078f07d3999e27cfda033f906c70e0 100755 (executable)
@@ -4,6 +4,7 @@
 
 import argparse
 from curses import wrapper
 
 import argparse
 from curses import wrapper
+import sys
 
 from . import display, parse
 from .deck import Status
 
 from . import display, parse
 from .deck import Status
@@ -26,7 +27,7 @@ def show(stack, headers):
     wrapper(display.get_key, stack, headers, idx)
 
 
     wrapper(display.get_key, stack, headers, idx)
 
 
-def main():
+def main(args=sys.argv):
     args = parse_args()
     if args.version:
         print("0.0.0")
     args = parse_args()
     if args.version:
         print("0.0.0")