netrc_util

Crates.ionetrc_util
lib.rsnetrc_util
version0.1.0
sourcesrc
created_at2024-03-21 07:21:28.97774
updated_at2024-03-21 07:21:28.97774
descriptionA simple libary for parsing netrc files
homepagehttps://www.github.com/nils-degroot/netrc_util
repositoryhttps://www.github.com/nils-degroot/netrc_util
max_upload_size
id1181306
size23,460
(nils-degroot)

documentation

README

netrc_util

A simple libary for parsing netrc files.

Usage

use netrc_util::{Host, NetrcParser};

fn main() {
    let netrc_content = "machine sample.test login user password pass";
    let host = Host::parse("sample.test").unwrap();

    let entry = NetrcParser::new(netrc_content).entry_for_host(&host).unwrap().unwrap();

    assert_eq!(entry.login(), Some("login"));
    assert_eq!(entry.password(), Some("pass"));
}
Commit count: 0

cargo fmt