added --auto option.