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