cli icon indicating copy to clipboard operation
cli copied to clipboard

[FEATURE REQUEST] Allow passing arbitrary arguments to viceroy via `fastly compute serve`

Open tedmielczarek-fastly opened this issue 2 years ago • 2 comments

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.

tedmielczarek-fastly avatar Oct 16 '23 17:10 tedmielczarek-fastly

Thanks @tedmielczarek-fastly I've created a ticket internally to investigate and track this request.

Integralist avatar Oct 17 '23 10:10 Integralist

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.

fgsch avatar Apr 24 '24 01:04 fgsch

Done.

fgsch avatar May 24 '24 18:05 fgsch