mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-08 05:17:52 -05:00
If an option used on cli is not recognized, the command aborts and displays an error message. If the typed option is similar to one of the recognized options, a hint is displayed. At the moment, there is a limitation on long options. Short options are not validated at the moment. See #2046
26 lines
626 B
PHP
Executable File
26 lines
626 B
PHP
Executable File
#!/usr/bin/php
|
|
<?php
|
|
require(__DIR__ . '/_cli.php');
|
|
|
|
$params = array(
|
|
'user:',
|
|
);
|
|
|
|
$options = getopt('', $params);
|
|
|
|
if (!validateOptions($argv, $params) || empty($options['user'])) {
|
|
fail('Usage: ' . basename(__FILE__) . " --user username");
|
|
}
|
|
|
|
$username = cliInitUser($options['user']);
|
|
|
|
fwrite(STDERR, 'FreshRSS actualizing user “' . $username . "”…\n");
|
|
|
|
list($nbUpdatedFeeds, $feed, $nbNewArticles) = FreshRSS_feed_Controller::actualizeFeed(0, '', true);
|
|
|
|
echo "FreshRSS actualized $nbUpdatedFeeds feeds for $username ($nbNewArticles new articles)\n";
|
|
|
|
invalidateHttpCache($username);
|
|
|
|
done($nbUpdatedFeeds > 0);
|