Prepare, configure, and manage Firecracker microVMs in seconds!
virtualization linux microvm firecracker

Merge pull request #15 from tsirysndr/feat/colored-json

feat: add colored_json dependency and update inspect command output formatting

authored by tsiry-sandratraina.com and committed by

GitHub 3e4d4f4f 09149707

+21 -1
+18
Cargo.lock
··· 617 checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" 618 619 [[package]] 620 name = "concurrent-queue" 621 version = "2.5.0" 622 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 995 "anyhow", 996 "chrono", 997 "clap 4.5.41", 998 "dirs", 999 "fire-config", 1000 "fire-server", ··· 4006 "thiserror 1.0.69", 4007 "winreg", 4008 ] 4009 4010 [[package]] 4011 name = "yoke"
··· 617 checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" 618 619 [[package]] 620 + name = "colored_json" 621 + version = "5.0.0" 622 + source = "registry+https://github.com/rust-lang/crates.io-index" 623 + checksum = "e35980a1b846f8e3e359fd18099172a0857140ba9230affc4f71348081e039b6" 624 + dependencies = [ 625 + "serde", 626 + "serde_json", 627 + "yansi", 628 + ] 629 + 630 + [[package]] 631 name = "concurrent-queue" 632 version = "2.5.0" 633 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1006 "anyhow", 1007 "chrono", 1008 "clap 4.5.41", 1009 + "colored_json", 1010 "dirs", 1011 "fire-config", 1012 "fire-server", ··· 4018 "thiserror 1.0.69", 4019 "winreg", 4020 ] 4021 + 4022 + [[package]] 4023 + name = "yansi" 4024 + version = "1.0.1" 4025 + source = "registry+https://github.com/rust-lang/crates.io-index" 4026 + checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" 4027 4028 [[package]] 4029 name = "yoke"
+1
crates/firecracker-up/Cargo.toml
··· 31 ] } 32 chrono = "0.4.42" 33 serde_json = "1.0.145"
··· 31 ] } 32 chrono = "0.4.42" 33 serde_json = "1.0.145" 34 + colored_json = "5.0.0"
+2 -1
crates/firecracker-up/src/cmd/inspect.rs
··· 1 use std::process; 2 3 use anyhow::Error; 4 use firecracker_state::repo; 5 use serde_json::json; 6 ··· 36 }); 37 38 let vm_json = serde_json::to_string_pretty(&vm)?; 39 - println!("{}", vm_json); 40 41 Ok(()) 42 }
··· 1 use std::process; 2 3 use anyhow::Error; 4 + use colored_json::ToColoredJson; 5 use firecracker_state::repo; 6 use serde_json::json; 7 ··· 37 }); 38 39 let vm_json = serde_json::to_string_pretty(&vm)?; 40 + println!("{}", vm_json.to_colored_json_auto()?); 41 42 Ok(()) 43 }