Extract cli parser from main