Update command line to handle nested json objects

change from simple iteration over input to a recursive call