gemini-dl/src/gemini-dl.php

52 lines
No EOL
1 KiB
PHP
Executable file

#!/usr/bin/env php
<?php
// Load dependencies
require_once __DIR__ .
DIRECTORY_SEPARATOR . '..'.
DIRECTORY_SEPARATOR . 'vendor' .
DIRECTORY_SEPARATOR . 'autoload.php';
use \Yggverse\GeminiDL\Controller\Cli;
try
{
// Start application
$cli = new Cli(
getopt(
'acd:ef:hi:kl:m:rs:t:u',
[
'absolute:',
'crawl:',
'delay:',
'external',
'follow:',
'help',
'index:',
'keep',
'level:',
'match:',
'raw',
'source:',
'target:',
'unique'
]
)
);
$cli->start();
}
// Something went wrong
catch (\Exception $data)
{
Cli::exception(
$data->getMessage(),
file_get_contents(
__DIR__ .
DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . 'help.gmi'
)
);
}