feat: shorthand search — grepturbo <pattern> without search subcommand#21
Conversation
…ttern> Patterns that don't match a known subcommand name are automatically routed to the search command, so both `grepturbo "foo"` and `grepturbo foo` work.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR modifies the ChangesImplicit search subcommand injection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
grepturbo <pattern>now works as a shorthand forgrepturbo search <pattern>grepturbo "foo") and unquoted (grepturbo foo) forms workgrepturbo search <pattern>continues to work unchangedHow it works
Before cobra parses args,
os.Argsis inspected: if the first argument isn't a known subcommand (build,search,init,help,completion) or a flag,searchis injected automatically.Test plan
grepturbo <pattern>returns same results asgrepturbo search <pattern>grepturbo search <pattern>still worksgrepturbo buildandgrepturbo initunaffectedgrepturbo -i .grepturbo <pattern>still workSummary by CodeRabbit
grepturbo <pattern>now works as a shorthand forgrepturbo search <pattern>, providing a faster way to perform searches while maintaining full backward compatibility with explicit subcommands.