gecos
This is a rust library to generate and parse gecos.
We started developing this library to be used in conjunction with libnss. For example, this library is used in the guest-users nss package.
Install
Simply install via cargo:
Usage
For a full reference, please check out the [Gecos] struct.
use TryFrom;
use ;
// read gecos string from passwd etc.
let raw_gecos_string = "Some Person,Room,Work phone,Home phone,Other 1,Other 2";
let mut gecos = from_gecos_string.unwrap;
// access fields like
// var field option for comp
assert_eq!;
// and you even can convert it back to a raw gecos string
assert_eq!;
// modifying fields work like this
gecos.full_name = Some;
// or more explicitly
gecos.room = Some;
assert_eq!;
assert_eq!;