Install commander package

This commit is contained in:
freearhey 2021-01-17 18:00:52 +03:00
parent f12d96f07e
commit 7649c7078c
3 changed files with 18 additions and 6 deletions

6
package-lock.json generated
View File

@ -32,6 +32,12 @@
"integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==",
"dev": true
},
"commander": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.0.0.tgz",
"integrity": "sha512-ovx/7NkTrnPuIV8sqk/GjUIIM1+iUQeqA3ye2VNpq9sVoiZsooObWlQy+OPWGI17GDaEoybuAGJm6U8yC077BA==",
"dev": true
},
"epg-parser": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/epg-parser/-/epg-parser-0.1.2.tgz",

View File

@ -9,6 +9,7 @@
"dependencies": {},
"devDependencies": {
"axios": "^0.21.1",
"commander": "^7.0.0",
"epg-parser": "^0.1.2",
"escape-string-regexp": "^2.0.0",
"iptv-checker-module": "^2.0.2",

View File

@ -1,11 +1,16 @@
const { program } = require('commander')
const helper = require('./helper')
const config = {
debug: process.env.npm_config_debug || false,
country: process.env.npm_config_country,
exclude: process.env.npm_config_exclude,
epg: process.env.npm_config_epg || false
}
program
.version('1.0.0', '-v, --version')
.usage('[OPTIONS]...')
.option('-d, --debug', 'Debug mode')
.option('-c, --country <country>', 'Comma-separated list of country codes')
.option('-e, --exclude <exclude>', 'Comma-separated list of country codes to be excluded ')
.option('--epg', 'Turn on EPG parser')
.parse(process.argv)
const config = program.opts()
let updated = 0
let items = []