I have a few folders, which I want to combine into a single branch view. But, I don't want to see all the sub directories of those folder. Maybe just the top, or 1 level down.
Is this possible?
Code: Select all
$ab = tab("get", "term");
$level = input("Enter recursion level...", "0 = No recursion<crlf>1 = One level deep<crlf>...", 0);
if !(regexmatches($ab, "(/md=|/maxdepth=)")) { $ab = replace($ab, "/:flat", "/md=$level:flat"); }
else { $ab = regexreplace($ab, "(/md=|/maxdepth=)(\d)", "$1$level"); }
goto $ab;
md=n -> maxdepth, n = levels to show
Code: Select all
"0 = No recursion<crlf>1 = One level deep<crlf>..."Code: Select all
// Get path
$ab = tab("get", "term");
//Ask for user input
$level = input("Enter recursion level...", "0 = No recursion<crlf>1 = One level deep<crlf>...", 0);
//Check if the path needs to be altered, or simply update the recursion level
if !(regexmatches($ab, "(/md=|/maxdepth=)")) { $ab = replace($ab, "/flat", "/md=$level:flat"); }
else { $ab = regexreplace($ab, "(/md=|/maxdepth=)(\d*)", "$1$level"); }
goto $abCode: Select all
// Get path
$ab = tab("get", "term");
//Get recursion level from path and add 1
$level = replace(regexmatches($ab, "\d*(?=:flat)"), "|","") + 1;
//Check if the path needs to be altered, or simply update the recursion level
if !(regexmatches($ab, "(/md=|/maxdepth=)")) { $ab = replace($ab, "/flat", "/md=$level:flat"); }
else { $ab = regexreplace($ab, "(/md=|/maxdepth=)(\d*)", "$1$level"); }
goto $ab;Code: Select all
// Get path
$ab = tab("get", "term");
//Get recursion level from path and subtract 1
$level = replace(regexmatches($ab, "\d*(?=:flat)"), "|","") - 1;
//Check level is not below 0
if $level < 0 { $level = 0; }
//Check if the path needs to be altered, or simply update the recursion level
if !(regexmatches($ab, "(/md=|/maxdepth=)")) { $ab = replace($ab, "/flat", "/md=$level:flat"); }
else { $ab = regexreplace($ab, "(/md=|/maxdepth=)(\d*)", "$1$level"); }
goto $ab;