SpacetimeDB
SpacetimeDB copied to clipboard
`spacetime --root-dir` does not work
Running spacetime with a custom --root-dir gives a cryptic error:
$ spacetime --root-dir ~/.local/bin
Error: a value is required for '--root-dir <root_dir>' but none was supplied
It does work if explicitly passed with =:
spacetime --root-dir=~/.local/bin
tenari@dzs-MacBook-Pro SpacetimeDB % cargo run --bin spacetimedb-update -- --root-dir ~/
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.20s
Running `target/debug/spacetimedb-update --root-dir /Users/tenari/`
error: 'spacetime' requires a subcommand but one was not provided
[subcommands: version, cli, self-install, help]
Usage: spacetime [OPTIONS] <COMMAND>
For more information, try '--help'.
tenari@dzs-MacBook-Pro SpacetimeDB % cargo run -p spacetimedb-update -- self-install --root-dir ~/
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.14s
Running `target/debug/spacetimedb-update self-install --root-dir /Users/tenari/`
The SpacetimeDB command line tool will now be installed into /Users/tenari/
Would you like to continue? no
Exiting.
I think this is fixed in master
tenari@dzs-MacBook-Pro SpacetimeDB % cargo run --bin spacetimedb-update -- --root-dir ~/ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.20s Running `target/debug/spacetimedb-update --root-dir /Users/tenari/` error: 'spacetime' requires a subcommand but one was not provided [subcommands: version, cli, self-install, help] Usage: spacetime [OPTIONS] <COMMAND> For more information, try '--help'. tenari@dzs-MacBook-Pro SpacetimeDB % cargo run -p spacetimedb-update -- self-install --root-dir ~/ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.14s Running `target/debug/spacetimedb-update self-install --root-dir /Users/tenari/` The SpacetimeDB command line tool will now be installed into /Users/tenari/ Would you like to continue? no Exiting.I think this is fixed in master
Unfortunately not. spacetimedb-update behaves differently if invoked from a binary called spacetime:
$ cargo build -p spacetimedb-update
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.33s
$ target/debug/spacetimedb-update --root-dir ~
error: 'spacetime' requires a subcommand but one was not provided
[subcommands: version, cli, self-install, help]
Usage: spacetime [OPTIONS] <COMMAND>
For more information, try '--help'.
$ cp target/debug/spacetimedb-update spacetime
$ ./spacetime --root-dir ~
Error: a value is required for '--root-dir <root_dir>' but none was supplied
This looks like it's due to the fact that we're parsing args "manually" in crates/update/src/proxy.rs (specifically, in PartialCliArgs::parse).