improvements on bash completion and parameter parsing