Skip to content

Commit 6ce1de4

Browse files
authored
fix(run): allow messages to start with dash (-) (#4904)
1 parent d9b0848 commit 6ce1de4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { CommandModule } from "yargs"
22

3-
export function cmd<T, U>(input: CommandModule<T, U>) {
3+
type WithDoubleDash<T> = T & { "--"?: string[] }
4+
5+
export function cmd<T, U>(input: CommandModule<T, WithDoubleDash<U>>) {
46
return input
57
}

packages/opencode/src/cli/cmd/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const RunCommand = cmd({
8888
})
8989
},
9090
handler: async (args) => {
91-
let message = args.message.join(" ")
91+
let message = [...args.message, ...(args["--"] || [])].join(" ")
9292

9393
const fileParts: any[] = []
9494
if (args.file) {

packages/opencode/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ process.on("uncaughtException", (e) => {
3939
})
4040

4141
const cli = yargs(hideBin(process.argv))
42+
.parserConfiguration({ "populate--": true })
4243
.scriptName("opencode")
4344
.help("help", "show help")
4445
.alias("help", "h")

0 commit comments

Comments
 (0)