1
0
Fork 0
forked from wry/wry

cli: add json output

This commit is contained in:
Julian Orth 2026-03-23 13:23:37 +01:00
parent 65aca4903b
commit f3d650f2de
19 changed files with 1755 additions and 453 deletions

View file

@ -1,5 +1,10 @@
use {
crate::{cli::GlobalArgs, compositor::config_dir, logger::Logger, utils::errorfmt::ErrorFmt},
crate::{
cli::{GlobalArgs, json::jsonl},
compositor::config_dir,
logger::Logger,
utils::errorfmt::ErrorFmt,
},
clap::{Args, Subcommand},
jay_toml_config::CONFIG_TOML,
std::path::Path,
@ -87,7 +92,12 @@ pub fn main(global: GlobalArgs, args: ConfigArgs) {
ConfigCmd::Path => {
let dir = dir();
let toml_path = Path::new(&dir).join(CONFIG_TOML);
println!("{}", toml_path.display());
if global.json {
let path = toml_path.display().to_string();
jsonl(&path);
} else {
println!("{}", toml_path.display());
}
}
ConfigCmd::OpenDir => {
const XDG_OPEN: &str = "xdg-open";