-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
installed programs should be able to take --reload argument #2580
Comments
Here is an example. flags can be got by the installed program > deno install echox https://github.com/denoland/deno_std/raw/master/installer/testdata/echo.ts > echox hello world --reload
hello, world, --reload I really don't known where the problem is. |
I mean that the --reload flag should be passed through to deno, in order to download a new version of the code. The problem comes from the ordering of arguments. In the future we will have the "--debug" flag. It would be very nice to be able to do "echox hello world --debug" |
This is gonna be tricky... Clap (our CLI parser) doesn't support out use case, where we'd like to pass global flag after last argument (because after subcommand, rest of args is forwarded to script as Example (pseudo code)
|
Maybe we can hack clap? I don't like the bash solution. |
One problem, which we had with --help is what if a deno program wants to use that. Is it easier/sufficient to do something like:
|
How about supporting env variables for controlling those? DENO_RELOAD=1 catj # => deno run --reload ...
DENO_DEBUG=1 catj # => deno run --debug ... |
To provide help/usage message for the program, check
The problem I have with this command (it was already prototyped in denoland/std#512) is that you have to type full URL again - so actually it's the same as installing the program again. I'd be willing to settle on
-1 for more env variables, let's figure out how to make flags work to our success.
I'm not sure, but on first sight I'd be pretty hard... I believe that bash solution is lowest hanging fruit.
This is still pretty esoteric... Let's look for reference in other implementations |
For an update there's no reason that has to be the case (you could reuse the existing if not passed). I still don't see the use case for this, when/why would regular users want to do this? |
The idea of this feature is that "installed programs" should still act as other Deno programs, with the ability to be debugged, to change the logging style, reload the source code.
|
I think it is misleading with program args |
Maybe we can filter out these arguments? It's especially troublesome in the situation of "--help" where you would hope that |
Then we arrive at solution proposed in this comment. Maybe it's not that bad after all? We'd have to support only 6 flags (3 options, each with short and long option). |
@bartlomieju I see the shell scripts as a very minimal way of launching into Deno. We should keep logic in Deno where it can be tested and modified. Shell is a terrible language to write in compared to Rust/TS. If we write the logic to bash scripts, there will be no way to change that after installation. Shell also isn't portable, so we'd end up having to duplicate the efforts on Windows I think it's very nice that the installed shell scripts are basically just a URL - it's easily understood by anyone even if they don't know how deno is working. |
I think we can add prefix, it's more clear |
@ry I see your point. I just had another idea come to my mind:
We'd have to decide if those flags should be "eaten" by parser (1) or still forwarded to script (2):
Third option would be to control this behavior by another flag (say
|
@NamPNQ Eh. I would hope we can find something more elegant. @bartlomieju That sounds like a hack that could work. I think the args should be eaten. |
@ry good! I'll raise a PR so we can iterate on the idea. |
I still haven't heard a use case. It seems to me this is a micro optimization for deno core developers.. but not useful for users. |
@hayd suppose you're installing
Command above will install latest available version of Of course this situation disappears if you installed from tagged URL ( I think |
If I install a program
I want to be able to use flags like
--reload
or-L=info
with the newly installed program:^-- does not work as intended.
The text was updated successfully, but these errors were encountered: