public function generate($_, $assoc_args)
    {
        $this->init_args(func_get_args());

        $updated = $this->update_salts($this->get_flag('force') ?: $this->salts_are_placeholders());

        if (! $this->env->save()) {
            WP_CLI::error('Failed to update salts.');
        }

        $skipped = $updated->pluck('skipped')->filter();
        $set = $this->salts->count() - $skipped->count();

        if ($set === count($this->salts)) {
            WP_CLI::success('Salts generated.');
        } elseif ($set) {
            WP_CLI::success("$set salts set.");
        }

        if (! $skipped->isEmpty()) {
            WP_CLI::line('Some keys were already defined in the environment file.');
            WP_CLI::line("Use 'dotenv salts regenerate' to update them.");
        }
    }