Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make user command does not accept a name argument #216

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

sconnole
Copy link
Contributor

When trying to create a user with the --no-interaction flag the following error occurs

php artisan cachet:make:user test@test.com --password="password" --admin --no-interaction

   Laravel\Prompts\Exceptions\NonInteractiveValidationException

  Required.

  at vendor/laravel/prompts/src/Concerns/Interactivity.php:32
     28▕
     29▕         $this->validate($default);
     30▕
     31▕         if ($this->state === 'error') {
  ➜  32▕             throw new NonInteractiveValidationException($this->error);
     33▕         }
     34▕
     35▕         return $default;
     36▕     }

      +17 vendor frames

  18  artisan:13
      Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))

There is currently no --name flag available

php artisan cachet:make:user test@test.com --password="password" --admin --name="test" --no-interaction


  The "--name" option does not exist.

This will provide the option to supply name as an argument

php artisan cachet:make:user --help
Description:
  Create a new user

Usage:
  cachet:make:user [options] [--] [<email>]

Arguments:
  email

Options:
      --password[=PASSWORD]  The user's password
      --admin                Whether the user is an admin
      --name[=NAME]          The name of the user
  -h, --help                 Display help for the given command. When no command is given display help for the list command
      --silent               Do not output any message
  -q, --quiet                Only errors are displayed. All other output is suppressed
  -V, --version              Display this application version
      --ansi|--no-ansi       Force (or disable --no-ansi) ANSI output
  -n, --no-interaction       Do not ask any interactive question
      --env[=ENV]            The environment the command should run under
  -v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
php artisan cachet:make:user test@test.com --password="password" --admin --name='test'  --no-interaction

   INFO  User created successfully.

user name is required as an argument, but can only be supplied via interactive mode. This adds 'name' as an argument
@jbrooksuk jbrooksuk merged commit b8675e1 into cachethq:main Jan 25, 2025
25 checks passed
@jbrooksuk
Copy link
Member

Thanks!

@jbrooksuk jbrooksuk added this to the v3.0 milestone Jan 25, 2025
jbrooksuk added a commit that referenced this pull request Feb 10, 2025
* main: (103 commits)
  Update PHPStan parameters
  Change schedule running
  Fix dutch translations (#231)
  fix: remove additional prompt for name (#227)
  [fix] name mapping in request data classes (#226)
  fix: define getTitle method on Settings pages to use localised name (#224)
  Set OG images
  Fix code styling
  Demo Mode (#223)
  Fix code styling
  fix: make user command does not accept a name argument (#216)
  Apply ordering of component groups to status page
  Use root language for local dialects
  Compile Assets
  Updated PH localization (#213)
  Bump vite from 5.4.8 to 5.4.14 (#214)
  Fix code styling
  Support the `HTTP_REMOTE_USER` header (#208)
  New adjustments added for German translation and added Dutch (#209)
  Fix code styling
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants