first version
support normal or json format output