Skip to content

refactor(width): one Width type for --width, the config file and Args - #37

Merged
borghei merged 2 commits into
mainfrom
refactor/width-type
Oct 23, 2026
Merged

borghei merged 2 commits into
mainfrom
refactor/width-type

Conversation

@borghei

@borghei borghei commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Follow-up to #34.

  • Args.width is now ink_md::Width { Auto, Columns(n), Full } (#[non_exhaustive]) instead of Option<u16> plus full_width: bool. One parser, Width::parse, serves --width and the config file.
  • Args implements Default, so library callers can write Args { width, ..Default::default() } and new fields stop breaking them.
  • The config file accepts width = "full", "wide" and "narrow" as well as a number. Bad values warn and are ignored.
  • README credits @narma for Honor full and numeric reader widths while preserving defaults #34.

Breaking for library users, so this goes out in 0.12.0.

Replaces Args.width: Option<u16> plus Args.full_width: bool with
Args.width: Width { Auto, Columns(n), Full }, shared by the CLI parser and
the config file, and adds Default for Args so library callers can write
Args { width, ..Default::default() } and stop breaking when fields are added.

The config file now takes the --width keywords: width = "full", "wide"
or "narrow" (previously only a number; strings were rejected).

Credits @narma in the README for #34.
@borghei
borghei merged commit 00b99a9 into main Oct 23, 2026
8 checks passed
@borghei
borghei deleted the refactor/width-type branch October 23, 2026 12:23
@borghei borghei mentioned this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant