diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b1ffcd5d756..a89bca3602c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add heuristic to skip candidate migrations inside `emit(…)` ([#18330](https://github.com/tailwindlabs/tailwindcss/pull/18330)) - Extract candidates with variants in Clojure/ClojureScript keywords ([#18338](https://github.com/tailwindlabs/tailwindcss/pull/18338)) +- Document `--watch=always` in the CLI's usage ([#18337](https://github.com/tailwindlabs/tailwindcss/pull/18337)) ## [4.1.10] - 2025-06-11 diff --git a/packages/@tailwindcss-cli/src/commands/build/index.ts b/packages/@tailwindcss-cli/src/commands/build/index.ts index 8babb5654671..206bf27fbca2 100644 --- a/packages/@tailwindcss-cli/src/commands/build/index.ts +++ b/packages/@tailwindcss-cli/src/commands/build/index.ts @@ -42,8 +42,10 @@ export function options() { }, '--watch': { type: 'boolean | string', - description: 'Watch for changes and rebuild as needed', + description: + 'Watch for changes and rebuild as needed, and use `always` to keep watching when stdin is closed', alias: '-w', + values: ['always'], }, '--minify': { type: 'boolean', diff --git a/packages/@tailwindcss-cli/src/commands/help/index.ts b/packages/@tailwindcss-cli/src/commands/help/index.ts index 20ee78208440..a28132062a85 100644 --- a/packages/@tailwindcss-cli/src/commands/help/index.ts +++ b/packages/@tailwindcss-cli/src/commands/help/index.ts @@ -112,7 +112,11 @@ export function help({ // `alias` followed by `, ` and followed by the `flag`. let maxOptionLength = 0 - for (let [flag, { alias }] of Object.entries(options)) { + for (let [flag, { alias, values }] of Object.entries(options)) { + if (values?.length) { + flag += `[=${values.join(', ')}]` + } + // The option string, which is the combination of the alias and the flag // but already properly indented based on the other aliases to ensure // everything is aligned properly. diff --git a/packages/@tailwindcss-cli/src/utils/args.ts b/packages/@tailwindcss-cli/src/utils/args.ts index 1e4e153b8a03..1306aa2f2500 100644 --- a/packages/@tailwindcss-cli/src/utils/args.ts +++ b/packages/@tailwindcss-cli/src/utils/args.ts @@ -7,6 +7,7 @@ export type Arg = { description: string alias?: `-${string}` default?: Types[keyof Types] + values?: string[] } }