Skip to content
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

Split the rune CLI up so there are individual binaries for each sub-command #357

Open
Michael-F-Bryan opened this issue Oct 12, 2021 · 0 comments
Labels
area - infrastructure Internal tooling and infrastructure (e.g. CI) category - enhancement New feature or request effort - easy This should be pretty simple priority - low This item can be put on the back-burner

Comments

@Michael-F-Bryan
Copy link
Contributor

A suggestion @f0rodo mentioned is being able to split rune run out of the rune CLI to simplify the process of installing from source.

One possible way we could implement this is by creating multiple sub-commands, taking inspiration from how Cargo does custom subcommands.

  • rune - a top-level binary which takes rune foo some-args and calls the rune-foo program with some-args as its arguments
  • rune-run - execute a Rune
  • rune-build - compile a Runefile into a Rune
  • rune-graph - take a Runefile and turn it into a DOT graph that can be visualised
  • ...

We can then use the required-features field in Cargo.toml to make sure a particular subcommand is only installed when running cargo install with the corresponding feature flag.

For example:

# crates/rune-cli/Cargo.toml
[package]
name = "hotg-rune-cli"

[[bin]]
name = "rune"
path = "src/bin/rune.rs"

[[bin]]
name = "rune-run"
path = "src/bin/rune-run.rs"
required-features = ["run"]

[[bin]]
name = "rune-build"
path = "src/bin/rune-build.rs"
required-features = ["build"]

...

[features]
default = ["run", "build", "..."]
# Subcommands
run = []
build = []
# Normal feature flags for altering behaviour
wasmer-runtime = ["wasmer", "run"]
wasm3-runtime = ["wasm3", "run"]

That way you can run cargo install hotg-rune-cli to get rune run and rune build, or you could choose to just get rune build by using cargo install hotg-rune-cli --no-default-features --features build.

@Michael-F-Bryan Michael-F-Bryan added category - enhancement New feature or request priority - low This item can be put on the back-burner effort - easy This should be pretty simple area - infrastructure Internal tooling and infrastructure (e.g. CI) labels Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area - infrastructure Internal tooling and infrastructure (e.g. CI) category - enhancement New feature or request effort - easy This should be pretty simple priority - low This item can be put on the back-burner
Projects
None yet
Development

No branches or pull requests

1 participant