add janky manpage search
This commit is contained in:
parent
cfe1720d35
commit
a031e7c21d
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
||||
<title>the south london library</title>
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||
<link rel='stylesheet' type='text/css' media='screen' href='/main.css'>
|
||||
</head>
|
||||
<body>
|
||||
<form method="get" name="commandform">
|
||||
<input id="search"
|
||||
class="search"
|
||||
type="text"
|
||||
name="command"
|
||||
placeholder="🔍 enter a command here">
|
||||
<input type="submit" name="submit" style="display: none" />
|
||||
</form>
|
||||
<?php
|
||||
$command = $_GET["command"];
|
||||
echo $command;
|
||||
$output=null;
|
||||
$retval=null;
|
||||
exec('man --html=cat ' . $command , $output, $retval);
|
||||
echo "Returned with status $retval and output:\n";
|
||||
foreach ($output as $line): ?>
|
||||
<?=$line?>
|
||||
<?php endforeach;?>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue