Created
May 25, 2019 09:33
-
-
Save hikari-no-yume/6e053d686f2f9f719a52ea26d6c3e3d4 to your computer and use it in GitHub Desktop.
makes a directory listing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php declare(strict_types=1); | |
$glob = glob($argv[1] ?? "*"); | |
echo "<!doctype html>"; | |
echo "<meta charset=utf-8>"; | |
echo "<body style=\"font-family: monospace;\">"; | |
echo "<ul>"; | |
foreach ($glob as $blob) { | |
echo "<li>"; | |
echo "<a href=\"", $blob, "\">", $blob, "</a>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment