Add OSDK command line interface

This commit is contained in:
Jianfeng Jiang
2024-02-18 09:42:31 +00:00
committed by Tate, Hongliang Tian
parent f2f991b239
commit 3b3d088767
34 changed files with 2615 additions and 46 deletions

37
osdk/src/error.rs Normal file
View File

@ -0,0 +1,37 @@
// SPDX-License-Identifier: MPL-2.0
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Errno {
CreateCrate = 1,
GetMetadata = 2,
AddRustToolchain = 3,
ParseMetadata = 4,
ExecuteCommand = 5,
}
/// Print error message to console
#[macro_export]
macro_rules! error_msg {
() => {
std::eprint!("")
};
($($arg:tt)*) => {{
std::eprint!("[Error]: ");
std::eprint!($($arg)*);
std::eprint!("\n")
}};
}
/// Print warning message to console
#[macro_export]
macro_rules! warn_msg {
() => {
std::eprint!("")
};
($($arg:tt)*) => {{
std::eprint!("[Warn]: ");
std::eprint!($($arg)*);
std::eprint!("\n")
}};
}