diff --git a/caddy/php-server.go b/caddy/php-server.go index 9baa981b..69ab3df4 100644 --- a/caddy/php-server.go +++ b/caddy/php-server.go @@ -28,7 +28,7 @@ import ( func init() { caddycmd.RegisterCommand(caddycmd.Command{ Name: "php-server", - Usage: "[--domain ] [--root ] [--listen ] [--worker /path/to/worker.php<,nb-workers>] [--watch ] [--access-log] [--debug] [--no-compress] [--mercure]", + Usage: "[--domain=] [--root=] [--listen=] [--worker=/path/to/worker.php<,nb-workers>] [--watch[=]]... [--access-log] [--debug] [--no-compress] [--mercure]", Short: "Spins up a production-ready PHP server", Long: ` A simple but production-ready PHP server. Useful for quick deployments, @@ -47,11 +47,14 @@ For more advanced use cases, see https://github.com/dunglas/frankenphp/blob/main cmd.Flags().StringP("root", "r", "", "The path to the root of the site") cmd.Flags().StringP("listen", "l", "", "The address to which to bind the listener") cmd.Flags().StringArrayP("worker", "w", []string{}, "Worker script") - cmd.Flags().StringArrayP("watch", "", []string{}, "Directory to watch for file changes") + cmd.Flags().StringArray("watch", []string{}, "Glob pattern of directories and files to watch for changes") cmd.Flags().BoolP("access-log", "a", false, "Enable the access log") cmd.Flags().BoolP("debug", "v", false, "Enable verbose debug logs") cmd.Flags().BoolP("mercure", "m", false, "Enable the built-in Mercure.rocks hub") - cmd.Flags().BoolP("no-compress", "", false, "Disable Zstandard, Brotli and Gzip compression") + cmd.Flags().Bool("no-compress", false, "Disable Zstandard, Brotli and Gzip compression") + + cmd.Flags().Lookup("watch").NoOptDefVal = defaultWatchPattern + cmd.RunE = caddycmd.WrapCommandFuncForCobra(cmdPHPServer) }, }) diff --git a/docs/fr/worker.md b/docs/fr/worker.md index 69923e81..e79d355d 100644 --- a/docs/fr/worker.md +++ b/docs/fr/worker.md @@ -32,7 +32,7 @@ Il est également possible de [redémarrer le worker en cas de changement de fic La commande suivante déclenchera un redémarrage si un fichier se terminant par `.php` dans le répertoire `/path/to/your/app/` ou ses sous-répertoires est modifié : ```console -frankenphp php-server --worker /path/to/your/worker/script.php --watch "/path/to/your/app/**/*.php" +frankenphp php-server --worker /path/to/your/worker/script.php --watch="/path/to/your/app/**/*.php" ``` ## Runtime Symfony diff --git a/docs/ru/worker.md b/docs/ru/worker.md index e0a727c8..86a20a53 100644 --- a/docs/ru/worker.md +++ b/docs/ru/worker.md @@ -32,7 +32,7 @@ frankenphp php-server --worker /path/to/your/worker/script.php Следующая команда выполнит перезапуск, если будет изменён любой файл с расширением `.php` в директории `/path/to/your/app/` или её поддиректориях: ```console -frankenphp php-server --worker /path/to/your/worker/script.php --watch "/path/to/your/app/**/*.php" +frankenphp php-server --worker /path/to/your/worker/script.php --watch="/path/to/your/app/**/*.php" ``` ## Symfony Runtime diff --git a/docs/worker.md b/docs/worker.md index 3188196e..31432695 100644 --- a/docs/worker.md +++ b/docs/worker.md @@ -32,7 +32,7 @@ It's also possible to [restart the worker on file changes](config.md#watching-fo The following command will trigger a restart if any file ending in `.php` in the `/path/to/your/app/` directory or subdirectories is modified: ```console -frankenphp php-server --worker /path/to/your/worker/script.php --watch "/path/to/your/app/**/*.php" +frankenphp php-server --worker /path/to/your/worker/script.php --watch="/path/to/your/app/**/*.php" ``` ## Symfony Runtime