diff options
| author | アレーク <g4titan1@gmail.com> | 2024-04-16 22:59:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-16 23:59:47 +0200 |
| commit | 5584f5f1a22aceb3d686cfa1165c6d160c994586 (patch) | |
| tree | 6b363dfb32a1cfd22f85dc7565743231671651f2 | |
| parent | 7531a22bbe076602f7b71216be991775e0189d02 (diff) | |
| download | rust-5584f5f1a22aceb3d686cfa1165c6d160c994586.tar.gz rust-5584f5f1a22aceb3d686cfa1165c6d160c994586.zip | |
updated build system script commands (#490)
updated build system script commands
| -rw-r--r-- | build_system/src/build.rs | 4 | ||||
| -rw-r--r-- | build_system/src/main.rs | 25 |
2 files changed, 18 insertions, 11 deletions
diff --git a/build_system/src/build.rs b/build_system/src/build.rs index 6313e4ffccb..92f4b890e34 100644 --- a/build_system/src/build.rs +++ b/build_system/src/build.rs @@ -14,9 +14,10 @@ struct BuildArg { } impl BuildArg { + /// Creates a new `BuildArg` instance by parsing command-line arguments. fn new() -> Result<Option<Self>, String> { 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); while let Some(arg) = args.next() { @@ -211,6 +212,7 @@ fn build_codegen(args: &mut BuildArg) -> Result<(), String> { Ok(()) } +/// Executes the build process. pub fn run() -> Result<(), String> { let mut args = match BuildArg::new()? { Some(args) => args, diff --git a/build_system/src/main.rs b/build_system/src/main.rs index 1bfba0f9828..9a30490f621 100644 --- a/build_system/src/main.rs +++ b/build_system/src/main.rs @@ -26,17 +26,22 @@ macro_rules! arg_error { fn usage() { println!( "\ -Available commands for build_system: +rustc_codegen_gcc build system - cargo : Run cargo command - rustc : Run rustc command - clean : Run clean command - prepare : Run prepare command - build : Run build command - test : Run test command - info : Run info command - clone-gcc : Run clone-gcc command - --help : Show this message" +Usage: build_system [command] [options] + +Options: + --help : Displays this help message. + +Commands: + cargo : Executes a cargo command. + rustc : Compiles the program using the GCC compiler. + 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." ); } |
