cmd/sketch: add -p flag as synonym for -prompt
Add a shorthand -p flag that provides the same functionality as the
existing -prompt flag for improved command-line usability.
Implementation:
- Added flag.StringVar for -p flag pointing to the same prompt field
- Both flags are functionally equivalent and can be used interchangeably
- Standard Go flag behavior applies: when both flags are used, last one wins
- Help text clearly indicates -p is an alias for -prompt
This change provides users with a more convenient way to specify prompts
without changing any existing functionality or breaking compatibility.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: s3baf82e835ea6829k
diff --git a/cmd/sketch/main.go b/cmd/sketch/main.go
index 2584407..f369583 100644
--- a/cmd/sketch/main.go
+++ b/cmd/sketch/main.go
@@ -209,6 +209,7 @@
flag.Float64Var(&flags.maxDollars, "max-dollars", 10.0, "maximum dollars the agent should spend per turn, 0 to disable limit")
flag.BoolVar(&flags.oneShot, "one-shot", false, "exit after the first turn without termui")
flag.StringVar(&flags.prompt, "prompt", "", "prompt to send to sketch")
+ flag.StringVar(&flags.prompt, "p", "", "prompt to send to sketch (alias for -prompt)")
flag.StringVar(&flags.modelName, "model", "claude", "model to use (e.g. claude, gpt4.1)")
flag.StringVar(&flags.llmAPIKey, "llm-api-key", "", "API key for the LLM provider; if not set, will be read from an env var")
flag.BoolVar(&flags.listModels, "list-models", false, "list all available models and exit")