updated build system script commands (#490)

updated build system script commands
This commit is contained in:
アレーク 2024-04-16 22:59:47 +01:00 committed by GitHub
parent 7531a22bbe
commit 5584f5f1a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 11 deletions

View File

@ -14,9 +14,10 @@ struct BuildArg {
} }
impl BuildArg { impl BuildArg {
/// Creates a new `BuildArg` instance by parsing command-line arguments.
fn new() -> Result<Option<Self>, String> { fn new() -> Result<Option<Self>, String> {
let mut build_arg = Self::default(); let mut build_arg = Self::default();
// We skip binary name and the `build` command. // Skip binary name and the `build` command.
let mut args = std::env::args().skip(2); let mut args = std::env::args().skip(2);
while let Some(arg) = args.next() { while let Some(arg) = args.next() {
@ -211,6 +212,7 @@ fn build_codegen(args: &mut BuildArg) -> Result<(), String> {
Ok(()) Ok(())
} }
/// Executes the build process.
pub fn run() -> Result<(), String> { pub fn run() -> Result<(), String> {
let mut args = match BuildArg::new()? { let mut args = match BuildArg::new()? {
Some(args) => args, Some(args) => args,

View File

@ -26,17 +26,22 @@ macro_rules! arg_error {
fn usage() { fn usage() {
println!( println!(
"\ "\
Available commands for build_system: rustc_codegen_gcc build system
cargo : Run cargo command Usage: build_system [command] [options]
rustc : Run rustc command
clean : Run clean command Options:
prepare : Run prepare command --help : Displays this help message.
build : Run build command
test : Run test command Commands:
info : Run info command cargo : Executes a cargo command.
clone-gcc : Run clone-gcc command rustc : Compiles the program using the GCC compiler.
--help : Show this message" clean : Cleans the build directory, removing all compiled files and artifacts.
prepare : Prepares the environment for building, including fetching dependencies and setting up configurations.
build : Compiles the project.
test : Runs tests for the project.
info : Displays information about the build environment and project configuration.
clone-gcc : Clones the GCC compiler from a specified source."
); );
} }