diff --git a/librocco_receipt_printer/cli.py b/librocco_receipt_printer/cli.py index a2fce5e..a052c07 100644 --- a/librocco_receipt_printer/cli.py +++ b/librocco_receipt_printer/cli.py @@ -25,5 +25,22 @@ def main(): print("Exiting") +def dry_run(): + """Dry run is used for `librocco-print-test` command. It prints a canned receipt + and is used to test the printer being connected and accessible. + + TODO: This should most definitely be an actual printer, not a test file + + TODO: When we proceed with the implementation (and formatting of receipts) we'd + probably want to store a dummy receipt and print it out (instead of just printing out the "Test receipt" string) + """ + + printer = DevPrinter(PRINT_OUTPUT_FILE) + printer.print("Test receipt\n") + + if __name__ == "__main__": main() + +if __name__ == "__dry_run__": + dry_run() diff --git a/setup.py b/setup.py index ad47ac8..6d89431 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ entry_points={ "console_scripts": [ "librocco-receipt-printer=librocco_receipt_printer.cli:main", + "librocco-print-test=librocco_receipt_printer.cli:dry_run", ], }, )