@@ -71,42 +71,35 @@ bool ffParseModuleOptions(const char* key, const char* value)
71
71
72
72
void ffPrepareCommandOption (FFdata * data )
73
73
{
74
- //If we don't have a custom structure, use the default one
75
- if (data -> structure .length == 0 )
76
- ffStrbufAppendS (& data -> structure , FASTFETCH_DATATEXT_STRUCTURE ); // Cannot use `ffStrbufSetStatic` here because we will modify the string
77
-
78
- if (ffStrbufContainIgnCaseS (& data -> structure , FF_CPUUSAGE_MODULE_NAME ))
74
+ if (ffStrbufSeparatedContainIgnCaseS (& data -> structure , FF_CPUUSAGE_MODULE_NAME , ':' ))
79
75
ffPrepareCPUUsage ();
80
76
81
- if (ffStrbufContainIgnCaseS (& data -> structure , FF_DISKIO_MODULE_NAME ))
77
+ if (ffStrbufSeparatedContainIgnCaseS (& data -> structure , FF_DISKIO_MODULE_NAME , ':' ))
82
78
{
83
79
__attribute__((__cleanup__ (ffDestroyDiskIOOptions ))) FFDiskIOOptions options ;
84
80
ffInitDiskIOOptions (& options );
85
81
ffPrepareDiskIO (& options );
86
82
}
87
83
88
- if (ffStrbufContainIgnCaseS (& data -> structure , FF_NETIO_MODULE_NAME ))
84
+ if (ffStrbufSeparatedContainIgnCaseS (& data -> structure , FF_NETIO_MODULE_NAME , ':' ))
89
85
{
90
86
__attribute__((__cleanup__ (ffDestroyNetIOOptions ))) FFNetIOOptions options ;
91
87
ffInitNetIOOptions (& options );
92
88
ffPrepareNetIO (& options );
93
89
}
94
90
95
- if (instance . config . general . multithreading )
91
+ if (ffStrbufSeparatedContainIgnCaseS ( & data -> structure , FF_PUBLICIP_MODULE_NAME , ':' ) )
96
92
{
97
- if (ffStrbufContainIgnCaseS (& data -> structure , FF_PUBLICIP_MODULE_NAME ))
98
- {
99
- __attribute__((__cleanup__ (ffDestroyPublicIpOptions ))) FFPublicIPOptions options ;
100
- ffInitPublicIpOptions (& options );
101
- ffPreparePublicIp (& options );
102
- }
93
+ __attribute__((__cleanup__ (ffDestroyPublicIpOptions ))) FFPublicIPOptions options ;
94
+ ffInitPublicIpOptions (& options );
95
+ ffPreparePublicIp (& options );
96
+ }
103
97
104
- if (ffStrbufContainIgnCaseS (& data -> structure , FF_WEATHER_MODULE_NAME ))
105
- {
106
- __attribute__((__cleanup__ (ffDestroyWeatherOptions ))) FFWeatherOptions options ;
107
- ffInitWeatherOptions (& options );
108
- ffPrepareWeather (& options );
109
- }
98
+ if (ffStrbufSeparatedContainIgnCaseS (& data -> structure , FF_WEATHER_MODULE_NAME , ':' ))
99
+ {
100
+ __attribute__((__cleanup__ (ffDestroyWeatherOptions ))) FFWeatherOptions options ;
101
+ ffInitWeatherOptions (& options );
102
+ ffPrepareWeather (& options );
110
103
}
111
104
}
112
105
0 commit comments