Skip to content

feat(ipinfo): accept multiple fields#639

Merged
rewolff merged 7 commits into
traviscross:masterfrom
Komzpa:darafei/multi-ipinfo
May 25, 2026
Merged

feat(ipinfo): accept multiple fields#639
rewolff merged 7 commits into
traviscross:masterfrom
Komzpa:darafei/multi-ipinfo

Conversation

@Komzpa

@Komzpa Komzpa commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • accept comma-separated --ipinfo field lists such as --ipinfo 0,1
  • print the selected fields together in curses/report-wide host prefixes
  • keep interactive y/z cycling compatible by collapsing back to a single selected field
  • add command-line parser coverage for valid and malformed field lists, including non-numeric entries
  • report malformed entries as ipinfo parser errors instead of a generic invalid argument

Fixes #201.

Inspired by the multiple-ipinfo behavior shown by yvs2014 in https://github.com/yvs2014/mtr085. This is a fresh implementation for the current upstream ui/asn.c code path rather than a cherry-pick from that fork.

Tests

  • git diff --check
  • make -j$(nproc)
  • sudo python3 ./test/cmdparse.py
  • ./mtr --ipinfo 0,1 --help
  • ./mtr --ipinfo 0,,1 --help exits non-zero with an ipinfo parser error
  • ./mtr --ipinfo 0,x --help exits non-zero with an ipinfo parser error

@Komzpa Komzpa force-pushed the darafei/multi-ipinfo branch 2 times, most recently from ce4b7bc to 9773d8a Compare May 9, 2026 09:45
@Komzpa Komzpa force-pushed the darafei/multi-ipinfo branch from 9773d8a to b57852f Compare May 25, 2026 11:45
@rewolff rewolff merged commit 1cfc82b into traviscross:master May 25, 2026
2 checks passed
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.

Unable to choose multiple "--ipinfo" settings

2 participants