diff -Nru libaddr-1.0.35.0~lunar/debian/changelog libaddr-1.0.36.0~lunar/debian/changelog --- libaddr-1.0.35.0~lunar/debian/changelog 2022-11-13 01:43:55.000000000 +0000 +++ libaddr-1.0.36.0~lunar/debian/changelog 2023-11-18 18:38:19.000000000 +0000 @@ -1,4 +1,11 @@ -libaddr (1.0.35.0~lunar) lunar; urgency=high +libaddr (1.0.36.0~lunar) lunar; urgency=high + + * Added the --version command line option to ifaces tool. + * Added a manual page for the ifaces tool. + + -- Alexis Wilke Sat, 18 Nov 2023 10:38:19 -0800 + +libaddr (1.0.35.0~jammy) jammy; urgency=high * Added tool to list interfaces with filtering support. * Added support for default IP address as "*". diff -Nru libaddr-1.0.35.0~lunar/debian/libaddr.install libaddr-1.0.36.0~lunar/debian/libaddr.install --- libaddr-1.0.35.0~lunar/debian/libaddr.install 2019-09-26 05:41:33.000000000 +0000 +++ libaddr-1.0.36.0~lunar/debian/libaddr.install 2023-11-18 18:37:20.000000000 +0000 @@ -1,2 +1,3 @@ usr/bin usr/lib/lib*.so.* +doc/ifaces.1 usr/share/man/man1/ diff -Nru libaddr-1.0.35.0~lunar/doc/ifaces.1 libaddr-1.0.36.0~lunar/doc/ifaces.1 --- libaddr-1.0.35.0~lunar/doc/ifaces.1 1970-01-01 00:00:00.000000000 +0000 +++ libaddr-1.0.36.0~lunar/doc/ifaces.1 2023-11-18 18:20:06.000000000 +0000 @@ -0,0 +1,60 @@ +.TH IFACES 1 "November 2023" "ifaces 1.x" "User Commands" +.SH NAME +ifaces \- List interface names +.SH SYNOPSIS +.B ifaces +[\fIOPTION\fR] +.SH DESCRIPTION +The \fBifaces(1)\fR tool prints out the list of interfaces available on your +computer. + +.SH "COMMAND LINE OPTIONS" +.TP +\fB\-\-asterisk\fR +Print an asterisk (*) for the default address (instead of 0.0.0.0 or ::). + +.TP +\fB\-d\fR, \fB\-\-default\fR +Only print information about the default interface. + +.TP +\fB\-h\fR, \fB\-\-help\fR +Print a brief document about the tool usage, then exit. + +.TP +\fB\-\-hide\-headers\fR +Do not print the headers of the output table. + +.TP +\fB\-\-loopback\fR +Only print the name of the loopback interface (usually "lo"). + +.TP +\fB\-\-name-only\fR +Only print the interface names. No address, columns, headers. + +.TP +\fB\-\-private\fR +Only print private interfaces. + +.TP +\fB\-\-public\fR +Only print public interfaces. + +.SH AUTHOR +Written by Alexis Wilke . +.SH "REPORTING BUGS" +Report bugs to . +.br +iplock home page: . +.SH COPYRIGHT +Copyright \(co 2023 Made to Order Software Corporation +.br +License: GPLv3 +.br +This is free software: you are free to change and redistribute it. +.br +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +.BR ipv4-routes (1), +.BR validate-ip (1) diff -Nru libaddr-1.0.35.0~lunar/tools/ifaces.cpp libaddr-1.0.36.0~lunar/tools/ifaces.cpp --- libaddr-1.0.35.0~lunar/tools/ifaces.cpp 2022-11-13 01:43:55.000000000 +0000 +++ libaddr-1.0.36.0~lunar/tools/ifaces.cpp 2023-11-18 18:26:56.000000000 +0000 @@ -33,6 +33,7 @@ // #include #include +#include // C++ @@ -82,9 +83,11 @@ " --hide-headers do not print the headers.\n" " --public only print name of public interfaces.\n" " --private only print name of private interfaces.\n" - " --loopback only print name of loopback interface.\n"; - " --asterisk print an asterisk for default addresses (instead of 0.0.0.0 or ::).\n"; - " --name-only only print the name of the interface.\n"; + " --loopback only print name of loopback interface.\n" + " --asterisk print an asterisk for default addresses (instead of 0.0.0.0 or ::).\n" + " --name-only only print the name of the interface.\n" + " --version | -V print out the version of ifaces.\n" + ; return 1; } else if(strcmp(argv[idx], "--hide-headers") == 0) @@ -116,6 +119,12 @@ { g_name_only = true; } + else if(strcmp(argv[idx], "-V") == 0 + || strcmp(argv[idx], "--version") == 0) + { + std::cout << LIBADDR_VERSION_STRING << '\n'; + return 0; + } else { std::cerr