mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Move subcommand branching into Options struct
This commit is contained in:
parent
1413f8c0b6
commit
158dac5e1c
2 changed files with 16 additions and 16 deletions
|
|
@ -41,6 +41,20 @@ pub struct Options {
|
|||
pub subcommand: Subcommand,
|
||||
}
|
||||
|
||||
impl Options {
|
||||
pub fn run(self) -> anyhow::Result<()> {
|
||||
match self.subcommand {
|
||||
Subcommand::Init(subcommand) => subcommand.run(),
|
||||
Subcommand::Serve(serve_options) => serve(self.global, serve_options),
|
||||
Subcommand::Build(subcommand) => subcommand.run(),
|
||||
Subcommand::Upload(upload_options) => upload(upload_options),
|
||||
Subcommand::FmtProject(subcommand) => subcommand.run(),
|
||||
Subcommand::Doc(subcommand) => subcommand.run(),
|
||||
Subcommand::Plugin(subcommand) => subcommand.run(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub struct GlobalOptions {
|
||||
/// Sets verbosity level. Can be specified multiple times.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue