Standalone Script Apps - Passing in page arguments issue

Standalone file -

ARGV | dump

Calling with: web run arg1 arg2 arg3


It seems like every other argument is skipped.

Generally you’d use named args in your scripts when specifying multiple args, e.g:

web run -arg1 val1 -arg2 val2

I’ve only used ARGV when passing a single arg, but I’ll look at resolving it so it’s not treated as a named arg.

Thanks, though I tried every combo of arg passing formats and it skips every other one. If you standardize it to named variables in the future that’d be awesome.

Not sure what you mean:

$ web run -arg1 val1 -arg2 val2

sets arguments available to the script, e.g:

{{ arg1 }}, {{ arg2 }}


val1, val2

This should now be resolved with the latest v0.0.45 just published to NuGet which you can update with:

$ dotnet tool update -g web

Basically all script args, including -name switches should be available in ARGV collection.

I’ve also made it so you can override App Settings from script args, so you can specify to use a db with:

$ web run -db sqlserver -db.connection "Server=localhost;Initial Catalog=mydb;Integrated Security=True"
1 Like

This is truly an awesome tool. Thanks for the quick turn around.

1 Like