@@ -179,6 +179,12 @@ void ffPrintDisk(FFDiskOptions* options)
179179 if (__builtin_expect (options -> folders .length == 0 , 1 ) && (disk -> type & ~options -> showTypes ))
180180 continue ;
181181
182+ if (options -> hideFolders .length && ffDiskMatchMountpoint (& options -> hideFolders , disk -> mountpoint .chars ))
183+ continue ;
184+
185+ if (options -> hideFS .length && ffStrbufMatchSeparated (& disk -> filesystem , & options -> hideFS , ':' ))
186+ continue ;
187+
182188 printDisk (options , disk , ++ index );
183189 }
184190 }
@@ -211,6 +217,12 @@ bool ffParseDiskCommandOptions(FFDiskOptions* options, const char* key, const ch
211217 return true;
212218 }
213219
220+ if (ffStrEqualsIgnCase (subKey , "hide-fs" ))
221+ {
222+ ffOptionParseString (key , value , & options -> hideFS );
223+ return true;
224+ }
225+
214226 if (ffStrEqualsIgnCase (subKey , "show-regular" ))
215227 {
216228 if (ffOptionParseBoolean (value ))
@@ -305,6 +317,12 @@ void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module)
305317 continue ;
306318 }
307319
320+ if (ffStrEqualsIgnCase (key , "hideFS" ))
321+ {
322+ ffStrbufSetS (& options -> hideFS , yyjson_get_str (val ));
323+ continue ;
324+ }
325+
308326 if (ffStrEqualsIgnCase (key , "showExternal" ))
309327 {
310328 if (yyjson_get_bool (val ))
@@ -397,6 +415,9 @@ void ffGenerateDiskJsonConfig(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso
397415 if (!ffStrbufEqual (& options -> hideFolders , & defaultOptions .hideFolders ))
398416 yyjson_mut_obj_add_strbuf (doc , module , "hideFolders" , & options -> hideFolders );
399417
418+ if (!ffStrbufEqual (& options -> hideFS , & defaultOptions .hideFS ))
419+ yyjson_mut_obj_add_strbuf (doc , module , "hideFS" , & options -> hideFS );
420+
400421 if (defaultOptions .calcType != options -> calcType )
401422 yyjson_mut_obj_add_bool (doc , module , "useAvailable" , options -> calcType == FF_DISK_CALC_TYPE_AVAILABLE );
402423
@@ -516,6 +537,7 @@ void ffInitDiskOptions(FFDiskOptions* options)
516537 #else
517538 ffStrbufInitStatic (& options -> hideFolders , "/efi:/boot:/boot/efi" );
518539 #endif
540+ ffStrbufInit (& options -> hideFS );
519541 options -> showTypes = FF_DISK_VOLUME_TYPE_REGULAR_BIT | FF_DISK_VOLUME_TYPE_EXTERNAL_BIT | FF_DISK_VOLUME_TYPE_READONLY_BIT ;
520542 options -> calcType = FF_DISK_CALC_TYPE_FREE ;
521543 options -> percent = (FFPercentageModuleConfig ) { 50 , 80 , 0 };
@@ -524,4 +546,7 @@ void ffInitDiskOptions(FFDiskOptions* options)
524546void ffDestroyDiskOptions (FFDiskOptions * options )
525547{
526548 ffOptionDestroyModuleArg (& options -> moduleArgs );
549+ ffStrbufDestroy (& options -> folders );
550+ ffStrbufDestroy (& options -> hideFolders );
551+ ffStrbufDestroy (& options -> hideFS );
527552}
0 commit comments