Skip to content

Commit

Permalink
support cli config
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Jul 20, 2024
1 parent 52c5d3b commit 94091e5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ const {argv: argvObj} = yargs(process.argv.slice(2))
describe: 'Password of Transmission RPC interface',
type: 'string',
})
.option('tyr-url', {
describe: 'URL to Transmission RPC interface',
type: 'string',
})
.option('tyr-token', {
describe: 'Username of Transmission RPC interface',
type: 'string',
})
.group(
[
'dehost',
Expand All @@ -128,6 +136,8 @@ const {argv: argvObj} = yargs(process.argv.slice(2))
'trurl',
'truser',
'trpass',
'tyr-url',
'tyr-token',
],
'When auth=none:',
)
Expand Down Expand Up @@ -316,6 +326,12 @@ if (argv.rtsocket != null || argv.rthost != null) {
username: argv.deuser,
password: argv.depass,
};
} else if (argv.tyrUrl != null) {
connectionSettings = {
client: 'tyr',
url: argv.tyrUrl,
token: argv.tyrToken,
};
}

let authMethod: Config['authMethod'] = 'default';
Expand Down

0 comments on commit 94091e5

Please sign in to comment.