diff --git a/include/ptouch.h b/include/ptouch.h index 61db5c8..2630994 100644 --- a/include/ptouch.h +++ b/include/ptouch.h @@ -104,3 +104,4 @@ int ptouch_getmaxwidth(ptouch_dev ptdev); int ptouch_enable_packbits(ptouch_dev ptdev); int ptouch_rasterstart(ptouch_dev ptdev); int ptouch_sendraster(ptouch_dev ptdev, uint8_t *data, size_t len); +void ptouch_list_supported(); diff --git a/src/libptouch.c b/src/libptouch.c index 9f81d1c..673c76e 100644 --- a/src/libptouch.c +++ b/src/libptouch.c @@ -330,3 +330,14 @@ int ptouch_sendraster(ptouch_dev ptdev, uint8_t *data, size_t len) } return rc; } + +void ptouch_list_supported() +{ + printf("Supported printers (some might have quirks)\n"); + for (int i=0; ptdevs[i].vid > 0; i++) { + if ((ptdevs[i].flags & FLAG_PLITE) != FLAG_PLITE) { + printf("\t%s\n", ptdevs[i].name); + } + } + return; +} diff --git a/src/ptouch-print.c b/src/ptouch-print.c index ebb634f..145e647 100644 --- a/src/ptouch-print.c +++ b/src/ptouch-print.c @@ -360,17 +360,21 @@ void usage(char *progname) { printf("usage: %s [options] \n", progname); printf("options:\n"); + printf("\t--debug\t\t\tenable debug output\n"); printf("\t--font \t\tuse font or \n"); + printf("\t--fontsize \tManually set fontsize\n"); printf("\t--writepng \tinstead of printing, write output to png file\n"); - printf("\t\t\t\tThis currently works only when using\n\t\t\t\tEXACTLY ONE --text statement\n"); - printf("print-commands:\n"); + printf("print commands:\n"); printf("\t--image \t\tprint the given image which must be a 2 color\n"); printf("\t\t\t\t(black/white) png\n"); printf("\t--text \t\tPrint 1-4 lines of text.\n"); printf("\t\t\t\tIf the text contains spaces, use quotation marks\n\t\t\t\taround it.\n"); printf("\t--cutmark\t\tPrint a mark where the tape should be cut\n"); - printf("\t--fontsize\t\tManually set fontsize\n"); printf("\t--pad \t\tAdd n pixels padding (blank tape)\n"); + printf("other commands:\n"); + printf("\t--version\t\tshow version info (required for bug report)\n"); + printf("\t--info\t\t\tshow info about detected tape\n"); + printf("\t--list-supported\tshow printers supported by this version\n"); exit(1); } @@ -429,6 +433,9 @@ int parse_args(int argc, char **argv) } else if (strcmp(&argv[i][1], "-version") == 0) { printf(_("ptouch-print version %s by Dominic Radermacher\n"), VERSION); exit(0); + } else if (strcmp(&argv[i][1], "-list-supported") == 0) { + ptouch_list_supported(); + exit(0); } else { usage(argv[0]); }