[cli/engine/commands/shell] separate sort groups only if they are more than 1 apart