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

tsc chokes on switches in --example=VALUE format #6758

Closed
ghost opened this issue Jan 30, 2016 · 5 comments
Closed

tsc chokes on switches in --example=VALUE format #6758

ghost opened this issue Jan 30, 2016 · 5 comments
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript

Comments

@ghost
Copy link

ghost commented Jan 30, 2016

Every now and then I pick up tsc and the following type of thing happens:

$ tsc --module=commonjs ./foo.ts
error TS5023: Unknown compiler option 'module=commonjs'.
$ # arrgh!
$ tsc --module commonjs ./foo.ts
$
@DanielRosenwasser
Copy link
Member

I'd be okay with this if the complexity of the command line parser didn't get too crazy. @mhegazy @rbuckton @RyanCavanaugh any thoughts?

@DanielRosenwasser DanielRosenwasser added the Suggestion An idea for TypeScript label Jan 30, 2016
@ahejlsberg
Copy link
Member

I'm not super crazy about this idea. One problem is that that it only works if there are no blanks before or after the =. Another is that it doesn't work well for boolean options (at least not with the suggested implementation). For example, --declaration=true would become --declaration followed by true, and we'd go look for a file named true.ts.

@ghost
Copy link
Author

ghost commented Jan 31, 2016

it only works if there are no blanks before or after the =

The pull request isn't really going rogue and making some spectacular design decision. It's more like the opposite. See my comment in the pull request about ls et al. If there are spaces around the "=", failure is the expected outcome.

This is really about getting tsc to accept long options in the same way that most every other command-line tool on my system does--includinggit--without surprising anybody.

Another is that it doesn't work well for boolean options

Yeah, I noticed that sometime after pushing to my branch this afternoon. It's easy enough to fix.

@ghost
Copy link
Author

ghost commented Jan 31, 2016

For comparison:

$ ls ./bin --format= long
ls: ambiguous argument ‘’ for ‘--format’
Valid arguments are:
  - ‘verbose’, ‘long’
  - ‘commas’
  - ‘horizontal’, ‘across’
  - ‘vertical’
  - ‘single-column’
Try 'ls --help' for more information.
$ ls ./bin --format=long
total 8
-rwxrwxr-x 1 tim tim 45 Jan 30 18:26 tsc
-rwxrwxr-x 1 tim tim 50 Jan 30 18:26 tsserver
$ 

@RyanCavanaugh RyanCavanaugh added the In Discussion Not yet reached consensus label Feb 8, 2016
@RyanCavanaugh RyanCavanaugh added Declined The issue was declined as something which matches the TypeScript vision and removed In Discussion Not yet reached consensus labels Mar 15, 2016
@RyanCavanaugh
Copy link
Member

Suggestions from ghosts are too spooky. If anyone would like this, please log a new issue.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants