diff --git a/.gitignore b/.gitignore index fcbd401c..46c37bd9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ CMakeLists.txt.user* backend/Makefile frontend/Makefile docs/manual.pdf +docs/zint.1.tex build-* win32/*.VC.opendb win32/*.VC.db diff --git a/ChangeLog b/ChangeLog index 59071a7d..22e9d6b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,9 @@ Version 2.10.0.9 (dev) not released yet - HANXIN, QRCODE/RMQR now warn when convert to GB 18030, Shift JIS resp. and no ECI given - GRIDMATRIX no longer attempts Latin-1 conversion when no ECI given +- CLI now returns ZINT_ERROR_INVALID_OPTION (8) on its failed option checks + and ZINT_WARN_INVALID_OPTION (2) on ignored options + NOTE: previously returned 1 and 0 respectively Changes ------- @@ -74,6 +77,8 @@ Changes - CLI: man page moved from frontend/zint.1.gz to docs/zint.1.gz, now generated from docs/zint.1.pmd - add README.linux to root dir +- CLI: return ZINT_ERROR_INVALID_OPTION instead of 1 on bad option and + ZINT_WARN_INVALID_OPTION instead of 0 on ignored option Bugs ---- diff --git a/docs/Makefile b/docs/Makefile index ff691615..dd7f1b81 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -14,6 +14,9 @@ INCLUDES_PDF = $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) INC_PDF = --include-in-header $(INC_HEADER_PDF) --include-before-body $(INC_BEFORE_BODY_PDF) INCLUDES_TXT = inc_header_txt.tex INC_TXT = --include-in-header $(INCLUDES_TXT) +SOURCE_MAN_PAGE = zint.1.pmd +OUT_MAN_PAGE = zint.1 +INC_HEADER_TEX_MAN = inc_header_man.tex IMAGES = \ images/zint.png \ images/zint-qt.png \ @@ -130,29 +133,55 @@ IMAGES = \ MAIN_FONT = mainfont="TeX Gyre Pagella" MONO_FONT = monofont="Liberation Mono" CJK_FONT = CJKmainfont="WenQuanYi Micro Hei Mono" -PDF_OPTS = --pdf-engine=xelatex --filter pandoc-tablenos --highlight-style=$(HIGHLIGHT_THEME) -V block-headings \ - -V colorlinks -V geometry:margin=20mm -V papersize=a4 --dpi=300 -M tablenos-warning-level=0 +PDF_OPTS = --pdf-engine=xelatex --filter pandoc-tablenos -M tablenos-warning-level=0 \ + --highlight-style=$(HIGHLIGHT_THEME) -V colorlinks -V geometry:margin=20mm -V papersize=a4 --dpi=300 +TEX_MAN_PAGE = zint.1.tex TXT_OPTS = --columns 80 --eol=lf -t plain -SOURCE_MAN = zint.1.pmd -OUT_MAN = zint.1 -MAN_OPTS = -t man -s +MAN_PAGE_OPTS = -s -t man -all : $(OUT_PDF) $(OUT_TXT) $(OUT_MAN) +all : $(OUT_PDF) $(OUT_TXT) $(OUT_MAN_PAGE) -$(OUT_PDF) : $(SOURCE) $(HIGHLIGHT_THEME) $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) $(IMAGES) Makefile - pandoc $(SOURCE) -f markdown $(INC_PDF) --toc --toc-depth=4 \ - -V $(MAIN_FONT) -V $(MONO_FONT) -V $(CJK_FONT) \ +$(OUT_PDF) : $(SOURCE) $(SOURCE_MAN_PAGE) $(HIGHLIGHT_THEME) $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) $(IMAGES) Makefile + pandoc $(SOURCE_MAN_PAGE) -f markdown \ $(PDF_OPTS) \ + -o $(TEX_MAN_PAGE) + sed -i -e 's/section{/subsection{/' $(TEX_MAN_PAGE) # Convert man page sections to subsections + pandoc $(SOURCE) -f markdown $(INC_PDF) --toc --toc-depth=4 \ + -V $(MAIN_FONT) -V $(MONO_FONT) -V $(CJK_FONT) -V block-headings \ + $(PDF_OPTS) \ + --include-after-body $(TEX_MAN_PAGE) \ -o $(OUT_PDF) -$(OUT_TXT) : $(SOURCE) $(INCLUDES_TXT) Makefile - pandoc $(SOURCE) -f markdown $(INC_TXT) --toc --toc-depth=4 \ +$(OUT_TXT) : $(SOURCE) $(SOURCE_MAN_PAGE) $(INCLUDES_TXT) Makefile + pandoc $(SOURCE) $(SOURCE_MAN_PAGE) -f markdown $(INC_TXT) --toc --toc-depth=4 \ -V $(MAIN_FONT) -V $(MONO_FONT) -V $(CJK_FONT) \ $(TXT_OPTS) \ -o $(OUT_TXT) - sed -i -e 's/ *$$//' $(OUT_TXT) + # Indent Man Page sections in TOC and remove trailing spaces + sed -i \ + -e 's/^\(- [A-Z][A-Z ]*\)$$/ \1/' \ + -e 's/ *$$//' \ + $(OUT_TXT) -$(OUT_MAN) : $(SOURCE_MAN) Makefile - pandoc $(SOURCE_MAN) -f markdown \ - $(MAN_OPTS) \ - -o $(OUT_MAN) +$(OUT_MAN_PAGE) : $(SOURCE_MAN_PAGE) Makefile + pandoc $(SOURCE_MAN_PAGE) -f markdown \ + $(MAN_PAGE_OPTS) \ + -o $(OUT_MAN_PAGE) + +# HTML demo + +OUT_HTML = manual.html +HTML_OPTS = --filter pandoc-tablenos -M tablenos-warning-level=0 --highlight-style=$(HIGHLIGHT_THEME) \ + --eol=lf -s -t html + +$(OUT_HTML) : $(SOURCE) $(SOURCE_MAN_PAGE) Makefile + pandoc $(SOURCE) $(SOURCE_MAN_PAGE) -f markdown --toc --toc-depth=4 \ + -V $(MAIN_FONT) -V $(MONO_FONT) -V $(CJK_FONT) \ + $(HTML_OPTS) \ + -o $(OUT_HTML) + # Indent Man Page sections in TOC & change Man Page sections h1 -> h2 + sed -i \ + -e 's/\(Man Page<\/a>\)<\/li>/\1
Currently supported standards include: " - "EN 798:1996, EN 12323:2005, ISO/IEC 15420:2009, ISO/IEC 15417:2007, " - "ISO/IEC 15438:2015, ISO/IEC 16022:2006, ISO/IEC 16023:2000, " - "ISO/IEC 16388:2007, ISO/IEC 18004:2015, ISO/IEC 20830:2021, " - "ISO/IEC 24723:2010, ISO/IEC 24724:2011, ISO/IEC 24728:2006, " - "ISO/IEC 24778:2008, ISO/IEC 16390:2007, ISO/IEC 21471:2019, " - "ANSI-HIBC 2.6-2016, ANSI/AIM BC12-1998, ANSI/AIM BC6-2000, " - "ANSI/AIM BC5-1995, AIM ISS-X-24, AIMD014 (v 1.63), USPS-B-3200" + "EN 798:1996, EN 12323:2005, ISO/IEC 15420:2009, " + "ISO/IEC 15417:2007, ISO/IEC 15438:2015, ISO/IEC 16022:2006, " + "ISO/IEC 16023:2000, ISO/IEC 16388:2007, ISO/IEC 18004:2015, " + "ISO/IEC 20830:2021, ISO/IEC 24723:2010, ISO/IEC 24724:2011, " + "ISO/IEC 24728:2006, ISO/IEC 24778:2008, ISO/IEC 16390:2007, " + "ISO/IEC 21471:2019, AIM USS Code One (1994), ANSI-HIBC 2.6-2016, " + "ANSI/AIM BC12-1998, ANSI/AIM BC6-2000, ANSI/AIM BC5-1995, " + "AIM ISS-X-24, AIMD014 (v 1.63), AIM ITS/04-023 (2022)" " |