Refactor CLI entry point (#2157)

Changes "deno --types" to "deno types"
and "deno --prefetch" to "deno prefetch"
This commit is contained in:
Bartek Iwańczuk 2019-04-21 17:34:18 +02:00 committed by Ryan Dahl
parent c08075053f
commit cd19da62d9
12 changed files with 425 additions and 404 deletions

View file

@ -15,9 +15,6 @@ import { setLocation } from "./location";
// builtin modules
import * as deno from "./deno";
// TODO(kitsonk) remove with `--types` below
import libDts from "gen/cli/lib/lib.deno_runtime.d.ts!string";
export default function denoMain(name?: string): void {
const startResMsg = os.start(name);
@ -31,13 +28,6 @@ export default function denoMain(name?: string): void {
os.exit(0);
}
// handle `--types`
// TODO(kitsonk) move to Rust fetching from compiler
if (startResMsg.typesFlag()) {
console.log(libDts);
os.exit(0);
}
const mainModule = startResMsg.mainModule();
if (mainModule) {
assert(mainModule.length > 0);