Typescript: Shorthand flags don't work with --build

Created on 4 Sep 2018  路  6Comments  路  Source: microsoft/TypeScript

TypeScript Version: 3.0.3


Search Terms:

project references
watch
build

Code

This doesn't work:

./node_modules/.bin/tsc --build -w
error TS5072: Unknown build option '-w'.

This does:

./node_modules/.bin/tsc --build --watch

Related Issues: https://github.com/Microsoft/TypeScript/issues/25613

Experience Enhancement Fixed Suggestion good first issue help wanted

Most helpful comment

@RyanCavanaugh you forgot to reopen, also this might be a good one for help wanted/good first issue?

All 6 comments

We only have a few build flags at the moment (and intend to add more later), so for the time being we're not assigning single-letter variants. Once we're more confident that watch will be the most common w option, we'll make the shorthand equivalents work

@RyanCavanaugh but -w is already the shorthand for --watch when using tsc without --build. Isn't that _really_ weird if -w changes conditionally based on whether or not it's used with --build?

$ tsc  --help
Version 3.0.3
...
 -w, --watch                                        Watch input files.

Just noticed we already have short flags for other stuff under --build... so yeah let's assign w to watch.

@RyanCavanaugh you forgot to reopen, also this might be a good one for help wanted/good first issue?

This is fixed in master?

This appears to be resolved in the nightly build:

$ npm install typescript@next

$ ./node_modules/.bin/tsc --version 
Version 3.2.0-dev.20180929

$ ./node_modules/.bin/tsc --build -w
[8:39:12 AM] Starting compilation in watch mode...
Was this page helpful?
0 / 5 - 0 ratings

Related issues

disshishkov picture disshishkov  路  224Comments

xealot picture xealot  路  150Comments

Taytay picture Taytay  路  174Comments

fdecampredon picture fdecampredon  路  358Comments

kimamula picture kimamula  路  147Comments