@@ -71,42 +71,35 @@ bool ffParseModuleOptions(const char* key, const char* value)
7171
7272void ffPrepareCommandOption (FFdata * data )
7373{
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 , ':' ))
7975 ffPrepareCPUUsage ();
8076
81- if (ffStrbufContainIgnCaseS (& data -> structure , FF_DISKIO_MODULE_NAME ))
77+ if (ffStrbufSeparatedContainIgnCaseS (& data -> structure , FF_DISKIO_MODULE_NAME , ':' ))
8278 {
8379 __attribute__((__cleanup__ (ffDestroyDiskIOOptions ))) FFDiskIOOptions options ;
8480 ffInitDiskIOOptions (& options );
8581 ffPrepareDiskIO (& options );
8682 }
8783
88- if (ffStrbufContainIgnCaseS (& data -> structure , FF_NETIO_MODULE_NAME ))
84+ if (ffStrbufSeparatedContainIgnCaseS (& data -> structure , FF_NETIO_MODULE_NAME , ':' ))
8985 {
9086 __attribute__((__cleanup__ (ffDestroyNetIOOptions ))) FFNetIOOptions options ;
9187 ffInitNetIOOptions (& options );
9288 ffPrepareNetIO (& options );
9389 }
9490
95- if (instance . config . general . multithreading )
91+ if (ffStrbufSeparatedContainIgnCaseS ( & data -> structure , FF_PUBLICIP_MODULE_NAME , ':' ) )
9692 {
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+ }
10397
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 );
110103 }
111104}
112105
0 commit comments