From 94091e50df4c446d837ea86691dc38c4fba76b10 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Sat, 20 Jul 2024 08:35:47 +0800 Subject: [PATCH] support cli config --- config.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config.ts b/config.ts index 8688b45a1..5b6306176 100644 --- a/config.ts +++ b/config.ts @@ -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', @@ -128,6 +136,8 @@ const {argv: argvObj} = yargs(process.argv.slice(2)) 'trurl', 'truser', 'trpass', + 'tyr-url', + 'tyr-token', ], 'When auth=none:', ) @@ -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';