update main.cpp with optparser