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,27 @@
|
||||
///|
|
||||
fn main {
|
||||
let raw_args = @env.args()
|
||||
let cli_args : Array[String] = []
|
||||
for i in 1..<raw_args.length() {
|
||||
cli_args.push(raw_args[i])
|
||||
}
|
||||
let opts = @lib.resolve_options(cli_args)
|
||||
match opts.error {
|
||||
Some(msg) => {
|
||||
println("Error: \{msg}")
|
||||
println("Run 'moonfetch --help' for usage.")
|
||||
@env.exit(1)
|
||||
}
|
||||
None => ()
|
||||
}
|
||||
if opts.show_help {
|
||||
println(@lib.help_text())
|
||||
return
|
||||
}
|
||||
if opts.show_version {
|
||||
println(@lib.version_text())
|
||||
return
|
||||
}
|
||||
let info = @lib.collect_system_info()
|
||||
println(@lib.render_fetch(info, opts))
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import {
|
||||
"experiments/moonfetch" @lib,
|
||||
"moonbitlang/core/env",
|
||||
}
|
||||
|
||||
pkgtype(kind: "executable")
|
||||
@@ -0,0 +1,12 @@
|
||||
// Generated using `moon info`, DON'T EDIT IT
|
||||
package "experiments/moonfetch/cmd/main"
|
||||
|
||||
// Values
|
||||
|
||||
// Errors
|
||||
|
||||
// Types and methods
|
||||
|
||||
// Type aliases
|
||||
|
||||
// Traits
|
||||
Reference in new issue
Block a user