Feature: Add -d switch to printtarg for custom target label string #20

Merged
gronod merged 1 commits from feature/issue-19-printtarg-custom-label into development 2026-08-28 20:05:43 +01:00
Owner

Summary

This PR implements the -d "<string>" switch for printtarg, allowing users to specify custom chart description/label text or suppress border labelling when passed an empty string (-d "").

Fixes #19

Changes

  • target/printtarg.c:
    • Added -d label CLI parsing in main().
    • Expanded label buffer to 1024 bytes and added safe bounded strncpy copying.
    • Implemented label omission logic (dopglabel = 0) when -d "" is supplied.
    • Added CHART_LABEL keyword to output .ti2 CGATS files for downstream traceability.
    • Added ps_escape_str() in PostScript rendering (ps_string, ps_vstring) to escape (, ), \ and normalize newlines.
    • Added null/empty string guards in PS and TIFF string rendering routines.
    • Updated usage() banner.
  • doc/printtarg.html:
    • Documented -d switch in command summary table and options detail section.
  • doc/ChangesSummary.html:
    • Added change note under latest release section.
### Summary This PR implements the `-d "<string>"` switch for `printtarg`, allowing users to specify custom chart description/label text or suppress border labelling when passed an empty string (`-d ""`). Fixes #19 ### Changes - **`target/printtarg.c`**: - Added `-d label` CLI parsing in `main()`. - Expanded `label` buffer to 1024 bytes and added safe bounded `strncpy` copying. - Implemented label omission logic (`dopglabel = 0`) when `-d ""` is supplied. - Added `CHART_LABEL` keyword to output `.ti2` CGATS files for downstream traceability. - Added `ps_escape_str()` in PostScript rendering (`ps_string`, `ps_vstring`) to escape `(`, `)`, `\` and normalize newlines. - Added null/empty string guards in PS and TIFF string rendering routines. - Updated `usage()` banner. - **`doc/printtarg.html`**: - Documented `-d` switch in command summary table and options detail section. - **`doc/ChangesSummary.html`**: - Added change note under latest release section.
gronod added 1 commit 2026-08-28 20:01:57 +01:00
gronod merged commit b763dd78d1 into development 2026-08-28 20:05:43 +01:00
Sign in to join this conversation.