Skip to content

Commit b6e759f

Browse files
committed
LocalIP / NetIO: make defaultRouteOnly defaults to true
1 parent 9ddefbc commit b6e759f

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Changes:
1313
* `--battery-use-setup-api`: control whether `SetupAPI` should be used on Windows to detect battery info, which supports multi batteries, but slower.
1414
* `--wm-detect-plugin`: control whether WM plugins should be detected. Note it's implemented with global processes enumeration and can report false results.
1515
* `--de-slow-version-detection`: control DE version should be detected with slow operations. It's usually not necessary and only provided as a backup.
16+
* `--localip-default-route-only` and `--netio-default-route-only` defaults to true to avoid large number of results
1617

1718
Features:
1819
* Quirks for MIPS platforms (CPU, Linux)

doc/json_schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@
12431243
"defaultRouteOnly": {
12441244
"description": "Show ips that are used for default routing only",
12451245
"type": "boolean",
1246-
"default": false
1246+
"default": true
12471247
},
12481248
"key": {
12491249
"$ref": "#/$defs/key"
@@ -1274,7 +1274,7 @@
12741274
"defaultRouteOnly": {
12751275
"description": "Show ips that are used for default routing only",
12761276
"type": "boolean",
1277-
"default": false
1277+
"default": true
12781278
},
12791279
"key": {
12801280
"$ref": "#/$defs/key"

src/data/help.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ Module specific options:
160160
--localip-show-mac <?value>: Show mac addresses in local ip module. Default is false
161161
--localip-show-loop <?value>: Show loop back addresses (127.0.0.1) in local ip module. Default is false
162162
--localip-name-prefix <str>: Show interfaces with given interface name prefix only. Default is empty
163-
--localip-default-route-only <?value>: Show the interface that is used for default routing only. Default is false
163+
--localip-default-route-only <?value>: Show the interface that is used for default routing only. Default is true
164164
--localip-compact <?value>: Show all IPs in one line. Default is false
165165
--netio-name-prefix <str>: Show interfaces with given name prefix only. Default is empty
166-
--netio-default-route-only <?value>: Show the interfac that is used for default routing only. Default is false
166+
--netio-default-route-only <?value>: Show the interfac that is used for default routing only. Default is true
167167
--publicip-timeout: Time in milliseconds to wait for the public ip server to respond. Default is disabled (0)
168168
--publicip-url: The URL of public IP detection server to be used.
169169
--weather-location: Set the location to be used. It must be URI encoded (eg a whitespace must be encoded as `+`).

src/modules/localip/localip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void ffPrintLocalIp(FFLocalIpOptions* options)
105105
if(options->moduleArgs.outputFormat.length == 0)
106106
{
107107
ffPrintLogoAndKey(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY);
108-
printIp(ip, !options->defaultRouteOnly);
108+
printIp(ip, true);
109109
putchar('\n');
110110
}
111111
else
@@ -370,7 +370,7 @@ void ffInitLocalIpOptions(FFLocalIpOptions* options)
370370

371371
options->showType = FF_LOCALIP_TYPE_IPV4_BIT;
372372
ffStrbufInit(&options->namePrefix);
373-
options->defaultRouteOnly = false;
373+
options->defaultRouteOnly = true;
374374
}
375375

376376
void ffDestroyLocalIpOptions(FFLocalIpOptions* options)

src/modules/netio/netio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void ffInitNetIOOptions(FFNetIOOptions* options)
230230
ffOptionInitModuleArg(&options->moduleArgs);
231231

232232
ffStrbufInit(&options->namePrefix);
233-
options->defaultRouteOnly = false;
233+
options->defaultRouteOnly = true;
234234
}
235235

236236
void ffDestroyNetIOOptions(FFNetIOOptions* options)

0 commit comments

Comments
 (0)