CLI option no-default-feeds

https://github.com/FreshRSS/FreshRSS/issues/1095
This commit is contained in:
Alexandre Alapetite
2016-10-24 20:29:08 +02:00
parent 879af85d3c
commit 1182129ce5
7 changed files with 50 additions and 5 deletions

View File

@@ -9,11 +9,12 @@ $options = getopt('', array(
'language:',
'email:',
'token:',
'no-default-feeds',
));
if (empty($options['user'])) {
fail('Usage: ' . basename(__FILE__) . " --user username ( --password 'password' --api-password 'api_password'" .
" --language en --email user@example.net --token 'longRandomString' )");
" --language en --email user@example.net --token 'longRandomString --no-default-feeds' )");
}
$username = $options['user'];
if (!ctype_alnum($username)) {
@@ -33,7 +34,9 @@ $ok = FreshRSS_user_Controller::createUser($username,
array(
'language' => empty($options['language']) ? '' : $options['language'],
'token' => empty($options['token']) ? '' : $options['token'],
));
),
!isset($options['no-default-feeds'])
);
if (!$ok) {
fail('FreshRSS could not create user!');