feat: implement moonfetch (fastfetch clone in MoonBit native)
Copilot Setup Steps / copilot-setup-steps (push) Successful in 21s
Copilot Setup Steps / copilot-setup-steps (push) Successful in 21s
This commit is contained in:
commit
ca918a4a34
21 files changed
+2129
No files matched your search
@@ -0,0 +1,141 @@
|
||||
// Generated using `moon info`, DON'T EDIT IT
|
||||
package "experiments/moonfetch"
|
||||
|
||||
import {
|
||||
"moonbitlang/core/debug",
|
||||
}
|
||||
|
||||
// Values
|
||||
pub fn available_logos() -> Array[String]
|
||||
|
||||
pub fn collect_system_info() -> SystemInfo
|
||||
|
||||
pub fn count_apk_installed(String) -> Int32
|
||||
|
||||
pub fn count_dpkg_installed(String) -> Int32
|
||||
|
||||
pub fn default_structure() -> Array[String]
|
||||
|
||||
pub fn detect_logo_name(String) -> String
|
||||
|
||||
pub fn escape_json_string(String) -> String
|
||||
|
||||
pub fn format_bytes_human(UInt64) -> String
|
||||
|
||||
pub fn format_uptime(Int32) -> String
|
||||
|
||||
pub fn format_usage(UInt64, UInt64) -> String
|
||||
|
||||
pub fn get_logo(String) -> Logo
|
||||
|
||||
pub fn help_text() -> String
|
||||
|
||||
pub fn pad_right_visible(String, Int32) -> String
|
||||
|
||||
pub fn parse_args(Array[String]) -> CliOptions
|
||||
|
||||
pub fn parse_config_content(String, CliOptions) -> CliOptions
|
||||
|
||||
pub fn parse_cpuinfo(String) -> CpuInfo
|
||||
|
||||
pub fn parse_int_str(String) -> Int32
|
||||
|
||||
pub fn parse_meminfo(String) -> MemInfo
|
||||
|
||||
pub fn parse_os_release(String) -> OsRelease
|
||||
|
||||
pub fn parse_structure(String) -> Array[String]
|
||||
|
||||
pub fn parse_uint64_str(String) -> UInt64
|
||||
|
||||
pub fn parse_uptime_seconds(String) -> Int32
|
||||
|
||||
pub fn render_colors_bar(Bool) -> Array[String]
|
||||
|
||||
pub fn render_fetch(SystemInfo, CliOptions) -> String
|
||||
|
||||
pub fn render_info_lines(SystemInfo, Array[String], String, Bool) -> Array[String]
|
||||
|
||||
pub fn resolve_options(Array[String]) -> CliOptions
|
||||
|
||||
pub fn trim_quotes(String) -> String
|
||||
|
||||
pub fn version_text() -> String
|
||||
|
||||
pub fn visible_len(String) -> Int32
|
||||
|
||||
// Errors
|
||||
|
||||
// Types and methods
|
||||
#derive(Eq, @debug.Debug)
|
||||
pub struct CliOptions {
|
||||
show_help : Bool
|
||||
show_version : Bool
|
||||
logo : String?
|
||||
no_logo : Bool
|
||||
json : Bool
|
||||
no_color : Bool
|
||||
structure : Array[String]
|
||||
config_path : String?
|
||||
error : String?
|
||||
}
|
||||
pub fn CliOptions::default() -> Self
|
||||
|
||||
#derive(Eq, @debug.Debug)
|
||||
pub struct CpuInfo {
|
||||
model : String
|
||||
cores : Int32
|
||||
mhz : String
|
||||
}
|
||||
|
||||
pub struct Logo {
|
||||
name : String
|
||||
primary_color : String
|
||||
secondary_color : String
|
||||
lines : Array[String]
|
||||
}
|
||||
|
||||
#derive(Eq, @debug.Debug)
|
||||
pub struct MemInfo {
|
||||
total_kib : UInt64
|
||||
available_kib : UInt64
|
||||
used_kib : UInt64
|
||||
}
|
||||
|
||||
#derive(Eq, @debug.Debug)
|
||||
pub struct OsRelease {
|
||||
pretty_name : String
|
||||
id : String
|
||||
name : String
|
||||
version_id : String
|
||||
}
|
||||
|
||||
pub(all) struct SystemInfo {
|
||||
username : String
|
||||
hostname : String
|
||||
os_id : String
|
||||
os_name : String
|
||||
host_model : String
|
||||
kernel : String
|
||||
arch : String
|
||||
uptime : String
|
||||
uptime_secs : Int32
|
||||
packages : String
|
||||
shell : String
|
||||
terminal : String
|
||||
de_wm : String
|
||||
cpu : String
|
||||
memory : String
|
||||
mem_used_kib : UInt64
|
||||
mem_total_kib : UInt64
|
||||
disk : String
|
||||
disk_used_bytes : UInt64
|
||||
disk_total_bytes : UInt64
|
||||
local_ip : String
|
||||
locale : String
|
||||
}
|
||||
pub fn SystemInfo::to_json(Self) -> String
|
||||
|
||||
// Type aliases
|
||||
|
||||
// Traits
|
||||
Reference in new issue
Block a user