Repository navigation
Parse cronic's options in any order, and report usage errors - #130
Conversation
* Accept `--expected-status N`, `--expected-status=N`, `--permit-stderr`, and `--duplicate-stderr` in any order, and `--` to end the options. * Require `--expected-status` to be an integer from 0 to 255. * Report a missing command or an unknown option (including a single-dash one such as `-v`) as a usage error, with exit status 64. * Add `-h` and `--help`. * Parse the options before creating the temporary directory. * Prefix `cronic`'s function names with `cronic_`, so that they do not hide a wrapped command named, for example, `usage` or `cleanup`.
…r's shell options * Option parsing and usage errors are now in plume-lib#130. * Run the command with all of the caller's shell options, as `set +o` reports them, rather than only `-e`, `-u`, and `-x`. * Turn off tracing of `cronic` only when xtrace came from an exported SHELLOPTS, so that `bash -x cronic` still traces `cronic`. * Prefix `cronic`'s variables with `CRONIC_`, so that `cronic` does not change a variable such as `DEBUG` or `OUT` that the caller exported, and unset them before running the command, so that a builtin or shell function does not see them.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughCronic now documents and parses Priority: ⬇️ Low Change: Feature Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue remains after normal checks. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✨ Finishing Touches🧪 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 |
…alue Running the wrapped command as `command -- "$@"` keeps a program from being shadowed by one of cronic's shell functions, whatever its name. The tests now check every function name, read from the script itself. Also: report "--expected-status requires a value" when the value is missing, point the README to `cronic --help`, and simplify the test's output checks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@coderabbitai review |
|
Split out of #129, which now handles only the shell options that the wrapped command runs with.
--expected-status N,--expected-status=N,--permit-stderr, and--duplicate-stderrin any order, and--to end the options.--expected-statusto be an integer from 0 to 255.-v) as a usage error, with exit status 64.-hand--help.cronic's function names withcronic_, so that they do not hide a wrapped command named, for example,usageorcleanup.