diff --git a/README.md b/README.md index 40a7bd9..349b864 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,47 @@ s = shortens the names displayed c = hides/shows hidden processes p = saves to file called "Profile" and opens directory for you +## To redefine these: +To redefine only one of the keys: + ```lua + piefiller:setKey(mode,key) + ``` + example: + ```lua + piefiller:setKey("increase_depth","up") + ``` +To redefine all of the keys: + ```lua + + table = { + "increase_depth" = "up" + } + piefiller:setKey(table) + + ``` +# For your own interpretation + If you wish to interpret the data on your own use piefiller:unpack(). + Output is a table as such: + ```lua + local data = { + items = { + { + name, + line_defined, + current_line, + source, + time_taken, + percentage, + caller, + } + }, + about = { + depth, + step, + totalTime, + }, + } + ``` # Additional notes The best depth to search for is 2 and 3. diff --git a/piefiller.lua b/piefiller.lua index 200b220..2077428 100644 --- a/piefiller.lua +++ b/piefiller.lua @@ -78,6 +78,9 @@ end function piefiller:setKey(table_or_mode,key) if type(table_or_mode) == "table" then self.keys = table_or_mode + for i,v in pairs(table_or_mode) do + if self.keys[i] then self.keys[i] = v end + end elseif type(table_or_mode) == "string" then if not self.keys[table_or_mode] then error("Invalid mode: "..tostring(table_or_mode)) end self.keys[table_or_mode] = key @@ -359,7 +362,7 @@ function piefiller:unpack(fn) current_line = v.cur, source = v.src, time_taken = v.time, - precentage = v.prc, + percentage = v.prc, caller = v.caller, } if fn then