rjc

Crates.iorjc
lib.rsrjc
version0.2.3
sourcesrc
created_at2023-07-11 03:46:31.004891
updated_at2023-08-02 04:30:20.48823
descriptionrjc converts the output of many commands, file-types, and strings to JSON, YAML, or TOML
homepagehttps://rjc.vercel.app/
repositoryhttps://github.com/clearfeld/rjc
max_upload_size
id913483
size155,636
Marko (clearfeld)

documentation

README

rjc

dir | rjc dir
{"meta":{"drive":"F","serial":"38EC-3395","directory":"F:\\Dev\\rjc","files":3,"directories":4},"resources":[{"date":"01/15/2023","time":"04:14 PM","is_dir":true,"size":null,"name":"."},{"date":"01/15/2023","time":"04:14 PM","is_dir":true,"size":null,"name":".."},{"date":"01/14/2023","time":"04:25 PM","is_dir":false,"size":8,"name":".gitignore"},{"date":"01/15/2023","time":"10:38 PM","is_dir":false,"size":11117,"name":"Cargo.lock"},{"date":"01/20/2023","time":"12:53 AM","is_dir":false,"size":437,"name":"Cargo.toml"},{"date":"01/21/2023","time":"02:18 PM","is_dir":true,"size":null,"name":"src"},{"date":"01/20/2023","time":"12:53 AM","is_dir":true,"size":null,"name":"target"}]}

Installation

Cargo Install (MacOS, Linux, Windows)

cargo install rjc

Binaries

For precompiled binaries, check the releases in this repo.

Library

rjc can also be used as a library.

use rjc::win32::dir::{DirData, parse};
use std::process::Command;

fn main() {
    let output = Command::new("cmd").args(["/C", "dir"]).output().expect("Failed to execute process.");

    let dir_data: DirData = parse(Some(String::from_utf8_lossy(&output.stdout).to_string()));

    println!("{}", dir_data.meta.drive);
}

Parsers

Win32

Commands Documentation
assoc details
dir details
netstat details
tasklist details

Unix

Commands Documentation
acpi details
arp details
chage details
cksum details
date details
du details
env details
file details
ls details
passwd details
time details
timedatectl details
shadow details
sysctl details
w details
wc details

Darwin

Commands Documentation
airport details

External

Commands Documentation
lsd details
ping details

Formats

Commands Documentation
email-address details
timestamp details
version details
Commit count: 115

cargo fmt