mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix(run): allow messages to start with dash (-) (#4904)
This commit is contained in:
parent
d9b0848a61
commit
6ce1de476a
3 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue