From 6e0361ab213eb867b3288995723e3e4ac8ecd77a Mon Sep 17 00:00:00 2001 From: UnrefinedBrain Date: Mon, 30 Sep 2024 00:22:46 +0000 Subject: [PATCH] add new options to docs --- docs/guide/cli.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/guide/cli.md b/docs/guide/cli.md index f1d2617..2232ce3 100644 --- a/docs/guide/cli.md +++ b/docs/guide/cli.md @@ -7,7 +7,9 @@ vue-metamorph provides a CLI codemod runner to faciliate running codemods agains | Option | Description | Default | | - | - | - | | --help | Print available options | N/A | +| --list-plugins | Lists all registered plugins and exists | N/A | | --files <glob> | Run transforms against these files using a [glob](https://www.npmjs.com/package/glob) pattern | `'**/src/**/*'` | +| --plugins <glob> | Only run plugins matching these [micromatch](https://github.com/micromatch/micromatch) patterns. This option can be passed multiple times to specify multiple patterns | `'*'` | ## API @@ -54,9 +56,11 @@ Options will be passed to the CodemodPlugin `transform()` and ManualMigrationPlu const myCodemod: CodemodPlugin = { name: 'myCodemod', type: 'codemod', - transform(scriptASTs, sfcAST, filename, utils, opts) { + transform({ opts }) { if (opts.myCustomOption) { - // behave differently + // do something + } else { + // do something else } } }