-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat(cli): support trivial cli args like --version #47
Conversation
🦋 Changeset detectedLatest commit: 63e6134 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Hmm, commitlint seems broken:
Not sure if this is a cryptic error somehow indirectly triggered by something in my PR or the version it's using is just completely broken irrespective of my PR. Also FYI, I noticed that the automation isn't deleting the |
I managed to reproduce it locally using act, and pushed a fix Will try to fix the problems with the other workflows. |
Fixed Vercel's deployment issue |
Huh, that's strange, it worked as expected in previous PRs. I will delete them manually and then monitor the behavior closely. |
How should the end user use TableX as a CLI? |
By "use it as a cli" I just mean that like any installed program it can be invoked from a terminal, not only from your OS's launcher, and for anything that can be invoked as a command it's useful if it at least tells you you're invoking it with nonsense args. As far as what actual useful options it could support, #46 was one thing I'd imagined from the start (parallel to the way you can invoke vscode on a particular path from your terminal as
|
I didn't mean what are the use cases, I meant how the user will invoke the |
Oh, for me on Linux, installing the downloaded .deb added a table-x executable on my path (/usr/bin/). Is your point that on other platforms the installation/usage steps are less self-explanatory about how to launch it from a terminal? |
Yes, because for example on Windows nothing is added to the path when I install it. |
Right, so I think what you're saying is that the advantages would be more geared towards some platforms than others, which doesn't seem like a problem but maybe you do have specific concerns around that? |
Yeah my general concerns is that it would be definitely better for the feature to be available for all platforms. |
I don't think Tauri's integration has anything to do with whether you can invoke programs from cli. It's just some thin convenience wrappers for handling whatever args you pass, with some kinda strange behavior defaults. You're thinking somehow the Tauri config helpers have something to do with making cli convenient to use on Windows? |
There are a couple of strange behaviors I am noticing here:
I think the issue with release builds on Windows is related to this tauri-apps/tauri#4118, so Windows users like me will not be able see any output on the terminal but will be able to use the CLI. I think maybe we can include this in the documentation with some notes for Windows users about the CLI behaviour and how they should add the app to their `PATH, wdyt? |
Sure, we can add some documentation notes if you're good with the changes in general. Are you thinking the issue you linked would explain "When in release build: Using plain clap: Not outputting anything", even though the bug is against Tauri and the repro is plain clap? That does sound worth digging into before merging anything. |
It sounds pretty sane actually, because if Tauri detaches from the console/terminal when running the GUI then even the simplest But I found a workaround here tauri-apps/tauri#8305 (comment), and it works like a charm! |
Could you confirm that everything is still working as expected on your OS, and if you have any other comments lmk. |
Actually as-is it gives me errors "use of undeclared crate or module `windows`" (where the two helper functions are still unconditionally defined and reference |
Fixes #42.
The advantages are that if you pass standard arguments like
--version
it will interpret those normally, and if you pass totally invalid args like--pod-bay-doors=open
it will tell you they're unrecognized instead of seeming to accept them and launching normally.The secret was to ignore Tauri's brittle cli config integration and just use clap directly. I asked how to get Tauri's hooks to behave normally (https://discord.com/channels/616186924390023171/1212281820302016552) but didn't get an answer, and anyway don't see any advantage to trying to use Tauri's helpers vs. using clap directly.