mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Modernize the doc subcommand
This commit is contained in:
@@ -12,7 +12,7 @@ fn run(global: GlobalOptions, subcommand: Subcommand) -> anyhow::Result<()> {
|
||||
Subcommand::Build(build_options) => cli::build(build_options)?,
|
||||
Subcommand::Upload(upload_options) => cli::upload(upload_options)?,
|
||||
Subcommand::FmtProject(subcommand) => subcommand.run()?,
|
||||
Subcommand::Doc => cli::doc()?,
|
||||
Subcommand::Doc(subcommand) => subcommand.run()?,
|
||||
Subcommand::Plugin(plugin_options) => cli::plugin(plugin_options)?,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
pub fn doc() -> Result<(), anyhow::Error> {
|
||||
opener::open("https://rojo.space/docs")?;
|
||||
Ok(())
|
||||
use structopt::StructOpt;
|
||||
|
||||
/// Open Rojo's documentation in your browser.
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub struct DocCommand {}
|
||||
|
||||
impl DocCommand {
|
||||
pub fn run(self) -> anyhow::Result<()> {
|
||||
opener::open("https://rojo.space/docs")?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ use structopt::StructOpt;
|
||||
use thiserror::Error;
|
||||
|
||||
pub use self::build::*;
|
||||
pub use self::doc::*;
|
||||
pub use self::doc::DocCommand;
|
||||
pub use self::fmt_project::FmtProjectCommand;
|
||||
pub use self::init::{InitCommand, InitKind};
|
||||
pub use self::plugin::*;
|
||||
@@ -114,9 +114,7 @@ pub enum Subcommand {
|
||||
Upload(UploadCommand),
|
||||
|
||||
FmtProject(FmtProjectCommand),
|
||||
|
||||
/// Open Rojo's documentation in your browser.
|
||||
Doc,
|
||||
Doc(DocCommand),
|
||||
|
||||
/// Manages Rojo's Roblox Studio plugin.
|
||||
Plugin(PluginCommand),
|
||||
|
||||
Reference in New Issue
Block a user