2024-09-11 03:16:54 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const config = require('config');
|
|
|
|
const yargs = require('yargs');
|
|
|
|
|
2024-09-11 03:16:54 +00:00
|
|
|
module.exports = yargs.command('npm start -- --user <username>').option('users', {
|
2024-09-11 03:16:54 +00:00
|
|
|
alias: 'user',
|
|
|
|
describe: 'Reddit usernames to fetch posts from',
|
|
|
|
type: 'array'
|
|
|
|
}).option('posts', {
|
|
|
|
alias: 'post',
|
|
|
|
describe: 'Reddit post IDs to fetch',
|
|
|
|
type: 'array'
|
|
|
|
}).option('limit', {
|
|
|
|
describe: 'Maximum amount of posts to fetch after filtering out ignored, cross- and reposts',
|
|
|
|
type: 'number',
|
|
|
|
default: config.fetch.limit
|
|
|
|
}).option('sort', {
|
|
|
|
describe: 'Property to sort posts by',
|
|
|
|
choices: ['new', 'top', 'hot', 'controversial'],
|
|
|
|
default: config.fetch.sort
|
|
|
|
}).option('ignore', {
|
|
|
|
describe: 'Ignore posts with any of these properties',
|
|
|
|
type: 'array',
|
|
|
|
choices: ['pinned', 'stickied', 'hidden', 'spoiler', 'over_18']
|
2024-09-11 03:16:55 +00:00
|
|
|
}).option('include', {
|
|
|
|
describe: 'Include only these sources',
|
|
|
|
type: 'array'
|
|
|
|
}).option('exclude', {
|
|
|
|
describe: 'Do not include these sources',
|
|
|
|
type: 'array'
|
2024-09-11 03:16:54 +00:00
|
|
|
}).option('archives', {
|
|
|
|
describe: 'Search archives for deleted posts',
|
|
|
|
type: 'boolean'
|
2024-09-11 03:16:54 +00:00
|
|
|
}).argv;
|