cli
cli copied to clipboard
[FEATURE REQUEST] Allow passing arbitrary arguments to viceroy via `fastly compute serve`
Is your feature request related to a problem? Please describe.
Viceroy recently (in v0.9.0) gained a new commandline option --unknown-import-behavior. It would be nice to be able to use this when using fastly compute serve.
Describe the solution you'd like
It might work to allow passing arbitrary options to viceroy by way of fastly compute serve. Perhaps by simply taking anything after a -- like many other tools that invoke sub-commands do? e.g.:
fastly compute serve --verbose -- --unknown-import-behavior=zero-or-null
Would result in the CLI executing viceroy like:
viceroy serve [computed options] --unknown-import-behavior=zero-or-null bin/main.wasm
That is, anything passed after -- would be inserted in the viceroy commandline after all computed options, but before the computed input wasm file.
Describe alternatives you've considered
A new matching option could be added to fastly compute serve to plumb this option down to viceroy. This feels a bit like busywork and exposes options that most users are unlikely to need to support niche use cases.
Additional context
One can work around this currently by avoiding fastly compute serve and running fastly compute build and then manually invoking viceroy, but it's a little clunky and also doesn't support the nice --watch functionality of the CLI.
Thanks @tedmielczarek-fastly I've created a ticket internally to investigate and track this request.
This has been implemented in #1186 using a slightly different approach as unfortunately there are other tools involved besides Viceroy.
I will leave this open until this feature is released.
Done.