mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 19:03:27 +00:00
Add OSDK command line interface
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
f2f991b239
commit
3b3d088767
37
osdk/src/error.rs
Normal file
37
osdk/src/error.rs
Normal 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")
|
||||
}};
|
||||
}
|
Reference in New Issue
Block a user