From 5a9b589515fa795a629d721bdbf4ef51bb8cf2ec Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 13 Jan 2017 12:27:43 +0100 Subject: ULTRASTRACKE --- useful/ultrastrace.php | 57 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/useful/ultrastrace.php b/useful/ultrastrace.php index 3c93f1cc..f0a3f0da 100755 --- a/useful/ultrastrace.php +++ b/useful/ultrastrace.php @@ -20,6 +20,12 @@ if ($argv[0] == '-u') { $unique = true; } +$brief = false; +if ($argv[0] == '-b') { + array_shift($argv); + $brief = true; +} + foreach ($argv as $fname) { $fh = fopen($fname, 'r'); if ($fh === false) die("File not found: $fname\n"); @@ -69,27 +75,40 @@ foreach ($argv as $fname) { fclose($fh); } -echo "│\n│\n│\n│ ******* Found libraries *******************************************************\n"; -foreach ($found as $key => $val) { - echo "│\n├──┬ $key\n"; - $count = count($val); - $i = 1; - foreach ($val as $loc) { - if ($i == $count) echo "│ ╰── $loc\n"; - else echo "│ ├── $loc\n"; - ++$i; +if ($brief) { + + foreach ($found as $key => $val) { + echo "Found: $key\n"; + } + foreach ($failed as $key => $val) { + echo "Missing: $key\n"; } -} -echo "│\n│\n│\n│ ******* Missing libraries *****************************************************\n"; -foreach ($failed as $key => $val) { - echo "│\n├──┬ $key\n"; - $count = count($val); - $i = 1; - foreach ($val as $loc) { - if ($i == $count) echo "│ ╰── $loc\n"; - else echo "│ ├── $loc\n"; - ++$i; +} else { + + echo "│\n│\n│\n│ ******* Found libraries *******************************************************\n"; + foreach ($found as $key => $val) { + echo "│\n├──┬ $key\n"; + $count = count($val); + $i = 1; + foreach ($val as $loc) { + if ($i == $count) echo "│ ╰── $loc\n"; + else echo "│ ├── $loc\n"; + ++$i; + } + } + + echo "│\n│\n│\n│ ******* Missing libraries *****************************************************\n"; + foreach ($failed as $key => $val) { + echo "│\n├──┬ $key\n"; + $count = count($val); + $i = 1; + foreach ($val as $loc) { + if ($i == $count) echo "│ ╰── $loc\n"; + else echo "│ ├── $loc\n"; + ++$i; + } } + } -- cgit v1.2.3-55-g7522