diff --git a/README.md b/README.md index be9e7bc..e982cfe 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Copykitku is a tool for replicating issues, merge requests or specific commits, Example usage: ``` -$ copykitku replicate -s https://github.com/ytdl-org/youtube-dl/issues/27483 -d https://git.sakamoto.pl/laudompat/haruhi-dl +$ copykitku replicate https://github.com/ytdl-org/youtube-dl/issues/27483 https://git.sakamoto.pl/laudompat/haruhi-dl Replicated successfully: https://git.sakamoto.pl/laudompat/haruhi-dl/-/issues/39 ``` diff --git a/src/cli/replicate.ts b/src/cli/replicate.ts index f3fb6ff..2b59316 100644 --- a/src/cli/replicate.ts +++ b/src/cli/replicate.ts @@ -10,9 +10,6 @@ export default class Replicate extends Command { static flags = { help: flags.help({ char: 'h' }), - source: flags.string({ char: 's', required: true }), - dest: flags.string({ char: 'd', required: true }), - destBranch: flags.string({ description: 'name of the new branch (optional for MRs, required for commits)', }), @@ -30,15 +27,26 @@ export default class Replicate extends Command { }), }; - static args = []; + static args = [ + { + name: 'source', + required: true, + description: 'the thing you want to replicate', + }, + { + name: 'dest', + required: true, + description: 'where you want the thing to be replicated', + }, + ]; async run() { - const { flags } = this.parse(Replicate); + const { flags, args } = this.parse(Replicate); const { destBranch, doNotCommit, remote, targetBranch } = flags; - const sourcePath = parsePath(flags.source); - const destPath = parsePath(flags.dest); + const sourcePath = parsePath(args.source); + const destPath = parsePath(args.dest); assert(sourcePath.entityID, 'Source must be a repo element, not a repo itself');