@@ -21,7 +21,7 @@ include("macros.jl")
2121include (" clipboard.jl" )
2222
2323"""
24- varinfo(m::Module=Main, pattern::Regex=r""; all::Bool = false, imported::Bool = false, sortby::Symbol = :name)
24+ varinfo(m::Module=Main, pattern::Regex=r""; all::Bool = false, imported::Bool = false, sortby::Symbol = :name, minsize::Int = 0 )
2525
2626Return a markdown table giving information about exported global variables in a module, optionally restricted
2727to those matching `pattern`.
@@ -32,8 +32,9 @@ The memory consumption estimate is an approximate lower bound on the size of the
3232- `imported` : also list objects explicitly imported from other modules.
3333- `recursive` : recursively include objects in sub-modules, observing the same settings in each.
3434- `sortby` : the column to sort results by. Options are `:name` (default), `:size`, and `:summary`.
35+ - `minsize` : only includes objects with size at least `minsize` bytes. Defaults to `0`.
3536"""
36- function varinfo (m:: Module = Main, pattern:: Regex = r" " ; all:: Bool = false , imported:: Bool = false , sortby:: Symbol = :name , recursive:: Bool = false )
37+ function varinfo (m:: Module = Main, pattern:: Regex = r" " ; all:: Bool = false , imported:: Bool = false , sortby:: Symbol = :name , recursive:: Bool = false , minsize :: Int = 0 )
3738 sortby in (:name , :size , :summary ) || throw (ArgumentError (" Unrecognized `sortby` value `:$sortby `. Possible options are `:name`, `:size`, and `:summary`" ))
3839 rows = Vector{Any}[]
3940 workqueue = [(m, " " ),]
@@ -54,7 +55,9 @@ function varinfo(m::Module=Main, pattern::Regex=r""; all::Bool = false, imported
5455 ss = summarysize (value)
5556 (format_bytes (ss), ss)
5657 end
57- push! (rows, Any[string (prep, v), ssize_str, summary (value), ssize])
58+ if ssize >= minsize
59+ push! (rows, Any[string (prep, v), ssize_str, summary (value), ssize])
60+ end
5861 end
5962 end
6063 let (col, rev) = if sortby == :name
0 commit comments