mirror of
https://github.com/rastapasta/mapscii.git
synced 2025-06-20 09:47:41 +02:00
comment out default values for options + lint
This commit is contained in:
parent
f7e50fcf41
commit
579805d97d
88
main.js
88
main.js
@ -1,4 +1,4 @@
|
|||||||
/*#
|
/* #
|
||||||
MapSCII - Terminal Map Viewer
|
MapSCII - Terminal Map Viewer
|
||||||
by Michael Strassburger <codepoet@cpan.org>
|
by Michael Strassburger <codepoet@cpan.org>
|
||||||
Discover the planet in your console!
|
Discover the planet in your console!
|
||||||
@ -6,65 +6,65 @@
|
|||||||
This scripts boots up the application.
|
This scripts boots up the application.
|
||||||
|
|
||||||
TODO: params parsing and so on
|
TODO: params parsing and so on
|
||||||
#*/
|
# */
|
||||||
'use strict';
|
'use strict'
|
||||||
const config = require('./src/config');
|
const config = require( './src/config' )
|
||||||
const Mapscii = require('./src/Mapscii');
|
const Mapscii = require( './src/Mapscii' )
|
||||||
const argv = require('yargs')
|
const argv = require( 'yargs' )
|
||||||
.option('latitude', {
|
.option( 'latitude', {
|
||||||
alias: 'lat',
|
alias: 'lat',
|
||||||
description: 'Latitude of initial centre',
|
description: 'Latitude of initial centre',
|
||||||
default: config.initialLat,
|
/* default: config.initialLat, */
|
||||||
type: 'number',
|
type: 'number'
|
||||||
})
|
} )
|
||||||
.option('longitude', {
|
.option( 'longitude', {
|
||||||
alias: 'lon',
|
alias: 'lon',
|
||||||
description: 'Longitude of initial centre',
|
description: 'Longitude of initial centre',
|
||||||
default: config.initialLon,
|
/* default: config.initialLon, */
|
||||||
type: 'number',
|
type: 'number'
|
||||||
})
|
} )
|
||||||
.option('zoom', {
|
.option( 'zoom', {
|
||||||
alias: 'z',
|
alias: 'z',
|
||||||
description: 'Initial zoom',
|
description: 'Initial zoom',
|
||||||
default: config.initialZoom,
|
/* default: config.initialZoom, */
|
||||||
type: 'number',
|
type: 'number'
|
||||||
})
|
} )
|
||||||
.option('width', {
|
.option( 'width', {
|
||||||
alias: 'w',
|
alias: 'w',
|
||||||
description: 'Fixed width of rendering',
|
description: 'Fixed width of rendering',
|
||||||
type: 'number',
|
type: 'number'
|
||||||
})
|
} )
|
||||||
.option('height', {
|
.option( 'height', {
|
||||||
alias: 'h',
|
alias: 'h',
|
||||||
description: 'Fixed height of rendering',
|
description: 'Fixed height of rendering',
|
||||||
type: 'number',
|
type: 'number'
|
||||||
})
|
} )
|
||||||
.option('braille', {
|
.option( 'braille', {
|
||||||
alias: 'b',
|
alias: 'b',
|
||||||
description: 'Activate braille rendering',
|
description: 'Activate braille rendering',
|
||||||
default: config.useBraille,
|
default: config.useBraille,
|
||||||
type: 'boolean',
|
type: 'boolean'
|
||||||
})
|
} )
|
||||||
.option('headless', {
|
.option( 'headless', {
|
||||||
alias: 'H',
|
alias: 'H',
|
||||||
description: 'Activate headless mode',
|
description: 'Activate headless mode',
|
||||||
default: config.headless,
|
default: config.headless,
|
||||||
type: 'boolean',
|
type: 'boolean'
|
||||||
})
|
} )
|
||||||
.option('tile_source', {
|
.option( 'tile_source', {
|
||||||
alias: 'tileSource',
|
alias: 'tileSource',
|
||||||
description: 'URL or path to osm2vectortiles source',
|
description: 'URL or path to osm2vectortiles source',
|
||||||
default: config.source,
|
default: config.source,
|
||||||
type: 'string',
|
type: 'string'
|
||||||
})
|
} )
|
||||||
.option('style_file', {
|
.option( 'style_file', {
|
||||||
alias: 'style',
|
alias: 'style',
|
||||||
description: 'path to json style file',
|
description: 'path to json style file',
|
||||||
default: config.styleFile,
|
default: config.styleFile,
|
||||||
type: 'string',
|
type: 'string'
|
||||||
})
|
} )
|
||||||
.strict()
|
.strict()
|
||||||
.argv;
|
.argv
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
initialLat: argv.latitude,
|
initialLat: argv.latitude,
|
||||||
@ -77,11 +77,11 @@ const options = {
|
|||||||
useBraille: argv.braille,
|
useBraille: argv.braille,
|
||||||
headless: argv.headless,
|
headless: argv.headless,
|
||||||
source: argv.tile_source,
|
source: argv.tile_source,
|
||||||
styleFile: argv.style_file,
|
styleFile: argv.style_file
|
||||||
};
|
}
|
||||||
|
|
||||||
const mapscii = new Mapscii(options);
|
const mapscii = new Mapscii( options )
|
||||||
mapscii.init().catch((err) => {
|
mapscii.init().catch( ( err ) => {
|
||||||
console.error('Failed to start MapSCII.');
|
console.error( 'Failed to start MapSCII.' )
|
||||||
console.error(err);
|
console.error( err )
|
||||||
});
|
} )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user