add some debug infos in shell and add a cmdline arg for debugging (-d)