lib: implemement parsecmdlineargs

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>