diff --git a/src/cli.rs b/src/cli.rs index 48332a8..d3fd6b9 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,6 +1,6 @@ use crate::{ error::Result, - subcommands::{self, CompileArgs, InitArgs}, + subcommands::{self, BuildArgs, InitArgs}, }; use clap::{Parser, Subcommand}; @@ -18,13 +18,13 @@ pub struct Args { pub enum Command { /// Initialize a new project. Init(InitArgs), - /// Compile the project. - Compile(CompileArgs), + /// Build the project. + Build(BuildArgs), #[cfg(feature = "zip")] - /// Compile and package the project. + /// Build and package the project. Package(subcommands::PackageArgs), #[cfg(feature = "lang-debug")] - /// Compile the project and dump the intermediate state. + /// Build the project and dump the intermediate state. LangDebug(subcommands::LangDebugArgs), } @@ -32,7 +32,7 @@ impl Args { pub fn run(&self) -> Result<()> { match &self.cmd { Command::Init(args) => subcommands::init(self.verbose, args)?, - Command::Compile(args) => subcommands::compile(self.verbose, args)?, + Command::Build(args) => subcommands::build(self.verbose, args)?, #[cfg(feature = "zip")] Command::Package(args) => subcommands::package(self.verbose, args)?, #[cfg(feature = "lang-debug")] diff --git a/src/subcommands/compile.rs b/src/subcommands/build.rs similarity index 88% rename from src/subcommands/compile.rs rename to src/subcommands/build.rs index 8fca0fe..431b582 100644 --- a/src/subcommands/compile.rs +++ b/src/subcommands/build.rs @@ -8,17 +8,17 @@ use std::{fs, path::PathBuf}; use crate::util; #[derive(Debug, clap::Args, Clone)] -pub struct CompileArgs { - /// The path of the project to compile. +pub struct BuildArgs { + /// The path of the project to build. #[clap(default_value = ".")] path: PathBuf, } -pub fn compile(_verbose: bool, args: &CompileArgs) -> Result<()> { +pub fn build(_verbose: bool, args: &BuildArgs) -> Result<()> { let path = args.path.as_path(); let str_path = util::to_absolute_path(path)?; - print_info(&format!("Compiling project at {}", str_path)); + print_info(&format!("Building project at {}", str_path)); let toml_path = if !path.exists() { print_error("The specified path does not exist."); @@ -60,7 +60,7 @@ pub fn compile(_verbose: bool, args: &CompileArgs) -> Result<()> { compiled.place(&dist_path)?; print_info(&format!( - "Finished compiling project to {}", + "Finished building project to {}", util::to_absolute_path(&dist_path)? )); diff --git a/src/subcommands/mod.rs b/src/subcommands/mod.rs index 695a256..edfbcc3 100644 --- a/src/subcommands/mod.rs +++ b/src/subcommands/mod.rs @@ -1,8 +1,8 @@ mod init; pub use init::{init, InitArgs}; -mod compile; -pub use compile::{compile, CompileArgs}; +mod build; +pub use build::{build, BuildArgs}; #[cfg(feature = "zip")] mod package;