#!/usr/bin/env node
/**
 * @license Copyright 2018 Google Inc. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 */

const updateNotifier = require('update-notifier');
// Tell user if there's a newer version of ndb.
updateNotifier({pkg: require('./package.json')}).notify();

const os = require('os');
const path = require('path');
const {launch} = require('./lib/launcher.js');

launch({
  configDir: path.join(os.homedir(), '.ndb'),
  argv: process.argv,
  cwd: process.cwd(),
  debugFrontend: !!process.env.NDB_DEBUG_FRONTEND
}).then(frontend => frontend.bringToFront());

@@ -869,16 +869,843 @@
 .js');%0A%0A
+if (process.argv.length %3E 2 && (process.argv%5B2%5D === '-v' %7C%7C process.argv%5B2%5D === '--version')) %7B%0A  console.log(%60v$%7Brequire('./package.json').version%7D%60);%0A  process.exit(0);%0A%7D%0A%0Aif (process.argv.length %3E 2 && process.argv%5B2%5D === '--help') %7B%0A  console.log('Usage:');%0A  console.log('');%0A  console.log('Use ndb instead of node command:');%0A  console.log('%5Ctndb server.js');%0A  console.log('%5Ctndb node server.js');%0A  console.log('');%0A  console.log('Prepend ndb in front of any other binary:');%0A  console.log('%5Ctndb npm run unit');%0A  console.log('%5Ctndb mocha');%0A  console.log('%5Ctndb npx mocha');%0A  console.log('');%0A  console.log('Launch ndb as a standalone application:');%0A  console.log('%5Ctndb .');%0A  console.log('');%0A  console.log('More information is available at https://github.com/GoogleChromeLabs/ndb#readme');%0A  process.exit(0);%0A%7D%0A%0A
 launch(%7B

support --version and --help flags (#55)