-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI should print basic usage help when invoked interactively #585
Comments
Totally agree. I didn't know we can check interactive shell when it's implemented. And help message is also important without any doubt. Thank you for volunteering to contribute code. |
My pleasure @harttle — this way is much better than writing our own CLI wrapper. Both this issue and the arguments #583 could be most easily handled by using commander. Would that be acceptable, or should I avoid any external dependencies? (I see that the package currently has no runtime dependencies) |
I'm thinking about the same question. I prefer not involving runtime dependency, especially not those require native bindings. |
Yeah I know, on the one hand it doesn't feel good to add a dependency to a package that so far has zero. On the other hand, doing the arg parsing and command usage in a robust and user-friendly way is reinventing the wheel with a lot of unnecessary code that will need to be tested, maintained, etc... and it will never come close to the robustness of using After thinking about this for a while and looking at the JS options we will map to, I don't think it's feasible to roll our own implementation. I would say the arguments in favor of taking a dependency on The only other option I can think of is to move the CLI script to BTW not sure what you mean by "native bindings" but I don't think commander requires any, does it? |
I just checked, it has zero dependency.
I trust your judgement. Let's do it, add that dependency. Keep it simple is always a good idea, and don't think about bundling it during roll-up. |
Work is underway. One question: for the most part it's clear which options make sense to expose through the CLI and which ones don't. But I'm not sure about this one: https://liquidjs.com/api/interfaces/liquid_options_.liquidoptions.html#Optional-keepOutputType The docs say:
What does that mean? |
keepOutputType is for not converting tag/filter return value to string. We don't need it (always be false) for CLI because STDOUT is always a string. |
👍 Thanks, removed it from the PR. |
🎉 This issue has been resolved in version 10.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Currently if CLI is invoked interactively (i.e. stdin is connected to a terminal) the CLI will await template input. There are probably no real-world scenarios in which input will be provided this way.
It would be better if a basic usage help was printed in this case, showing the user how the CLI can be used.
If idea is supported by maintainers, I will contribute this as a PR.
Related to #583 and #584.
The text was updated successfully, but these errors were encountered: