--filename --inet --inet6 --udp --tcp --address --first-ttl
--max-ttl --max-unknown --port --localport --psize --bitpattern
--interval --gracetime --tos --mpls --timeout --mark --report
- --report-wide --report-cycles --json --xml --csv --raw --split
+ --report-wide --report-on-exit --report-cycles --json --xml --csv
+ --raw --split
--curses --displaymode --gtk --no-dns --show-ips --order --ipinfo
--aslookup --help --version
'
self.assertIn('Drop', reply.stdout)
self.assertIn('Jint', reply.stdout)
+ def test_help_lists_report_on_exit(self):
+ 'Test that the curses exit snapshot option remains advertised.'
+
+ reply = self.run_mtr('--help')
+
+ self.assertEqual(reply.returncode, 0)
+ self.assertIn('--report-on-exit', reply.stdout)
+
def test_port_with_tcp_succeeds_flag(self):
'Test that specifying -P with -T (TCP) succeeds.'
#endif
fputs(" -r, --report output using report mode\n", out);
fputs(" -w, --report-wide output wide report\n", out);
+ fputs(" --report-on-exit print report after curses exits\n", out);
fputs(" -c, --report-cycles COUNT set the number of pings sent\n", out);
#ifdef HAVE_JANSSON
fputs(" -j, --json output json\n", out);
*/
enum {
OPT_DISPLAYMODE = CHAR_MAX + 1,
- OPT_IPINFO4 = CHAR_MAX + 2,
+ OPT_REPORT_ON_EXIT = CHAR_MAX + 2,
+ OPT_IPINFO4 = CHAR_MAX + 3,
#ifdef ENABLE_IPV6
- OPT_IPINFO6 = CHAR_MAX + 3,
- OPT_CACHE = CHAR_MAX + 4,
+ OPT_IPINFO6 = CHAR_MAX + 4,
+ OPT_CACHE = CHAR_MAX + 5,
#else
- OPT_CACHE = CHAR_MAX + 3,
+ OPT_CACHE = CHAR_MAX + 4,
#endif /* ifdef ENABLE_IPV6 */
};
static const struct option long_options[] = {
{"report", 0, NULL, 'r'},
{"report-wide", 0, NULL, 'w'},
+ {"report-on-exit", 0, NULL, OPT_REPORT_ON_EXIT},
{"xml", 0, NULL, 'x'},
#ifdef HAVE_CURSES
{"curses", 0, NULL, 't'},
ctl->reportwide = 1;
ctl->DisplayMode = DisplayReport;
break;
+ case OPT_REPORT_ON_EXIT:
+ ctl->ReportOnExit = 1;
+ break;
#ifdef HAVE_CURSES
case 't':
ctl->DisplayMode = DisplayCurses;
ForceMaxPing:1,
use_dns:1, cache:1,
show_ips:1,
- enablempls:1, dns:1, reportwide:1, Interactive:1, DisplayMode:5, CompactLayout:1;
+ enablempls:1, dns:1, reportwide:1, Interactive:1, DisplayMode:5,
+ CompactLayout:1, ReportOnExit:1;
#ifdef HAVE_IPINFO
#ifdef ENABLE_IPV6
char *ipinfo_provider6;