diff options
| author | U Cirello <[email protected]> | 2025-12-02 10:52:05 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-02 12:52:05 -0600 |
| commit | 6ce1de476a87b4dd82f4281650d6a473c030aafe (patch) | |
| tree | 8ccee22a55f02d84e7bd9502b114b35b5fbbf25d | |
| parent | d9b0848a611eddb2283e888821e1dba7676a3744 (diff) | |
| download | opencode-6ce1de476a87b4dd82f4281650d6a473c030aafe.tar.gz opencode-6ce1de476a87b4dd82f4281650d6a473c030aafe.zip | |
fix(run): allow messages to start with dash (-) (#4904)
| -rw-r--r-- | packages/opencode/src/cli/cmd/cmd.ts | 4 | ||||
| -rw-r--r-- | packages/opencode/src/cli/cmd/run.ts | 2 | ||||
| -rw-r--r-- | packages/opencode/src/index.ts | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/packages/opencode/src/cli/cmd/cmd.ts b/packages/opencode/src/cli/cmd/cmd.ts index ee6da7b45..fe6d62d7b 100644 --- a/packages/opencode/src/cli/cmd/cmd.ts +++ b/packages/opencode/src/cli/cmd/cmd.ts @@ -1,5 +1,7 @@ import type { CommandModule } from "yargs" -export function cmd<T, U>(input: CommandModule<T, U>) { +type WithDoubleDash<T> = T & { "--"?: string[] } + +export function cmd<T, U>(input: CommandModule<T, WithDoubleDash<U>>) { return input } diff --git a/packages/opencode/src/cli/cmd/run.ts b/packages/opencode/src/cli/cmd/run.ts index b646f0b15..847b19adb 100644 --- a/packages/opencode/src/cli/cmd/run.ts +++ b/packages/opencode/src/cli/cmd/run.ts @@ -88,7 +88,7 @@ export const RunCommand = cmd({ }) }, handler: async (args) => { - let message = args.message.join(" ") + let message = [...args.message, ...(args["--"] || [])].join(" ") const fileParts: any[] = [] if (args.file) { diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts index 38b6b5a3f..5fb6f966c 100644 --- a/packages/opencode/src/index.ts +++ b/packages/opencode/src/index.ts @@ -39,6 +39,7 @@ process.on("uncaughtException", (e) => { }) const cli = yargs(hideBin(process.argv)) + .parserConfiguration({ "populate--": true }) .scriptName("opencode") .help("help", "show help") .alias("help", "h") |
