diff --git a/cli/valet.php b/cli/valet.php index 965d53b70..6eebdf5c1 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -373,12 +373,21 @@ /** * Install the sudoers.d entries so password is no longer required. */ - $app->command('trust', function () { + $app->command('trust [--off]', function ($off) { + if ($off) { + Brew::removeSudoersEntry(); + Valet::removeSudoersEntry(); + + return info('Sudoers entries have been removed for Brew and Valet.'); + } + Brew::createSudoersEntry(); Valet::createSudoersEntry(); info('Sudoers entries have been added for Brew and Valet.'); - })->descriptions('Add sudoers files for Brew and Valet to make Valet commands run without passwords'); + })->descriptions('Add sudoers files for Brew and Valet to make Valet commands run without passwords', [ + '--off' => 'Remove the sudoers files so normal sudo password prompts are required.' + ]); /** * Allow the user to change the version of php valet uses