Skip to content

Commit

Permalink
Fix help text and banner
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMarex authored and Patrick Niklaus committed Apr 17, 2018
1 parent 29db0c8 commit 0a1d190
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions scripts/osrm-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,21 @@ function BoundingBox(x) {
}
const optionsList = [
{name: 'help', alias: 'h', type: Boolean, description: 'Display this usage guide.', defaultValue: false},
{name: 'server', alias: 's', type: ServerDetails, defaultValue: ServerDetails('localhost:5000'),
description: 'OSRM routing server', typeLabel: '[underline]{hostname[:port]}'},
{name: 'path', alias: 'p', type: String, defaultValue: '/route/v1/driving/{};{}',
description: 'OSRM query path with {} coordinate placeholders, default /route/v1/driving/{};{}', typeLabel: '[underline]{path}'},
{name: 'filter', alias: 'f', type: String, defaultValue: ['$.routes[0].weight'], multiple: true,
description: 'JSONPath filters, default "$.routes[0].weight"', typeLabel: '[underline]{filter}'},
{name: 'bounding-box', alias: 'b', type: BoundingBox, defaultValue: BoundingBox('5.86442,47.2654,15.0508,55.1478'), multiple: true,
description: 'queries bounding box, default "5.86442,47.2654,15.0508,55.1478"', typeLabel: '[underline]{west,south,east,north}'},
{name: 'max-sockets', alias: 'm', type: Number, defaultValue: 1,
description: 'how many concurrent sockets the agent can have open per origin, default 1', typeLabel: '[underline]{number}'},
{name: 'number', alias: 'n', type: Number, defaultValue: 10,
description: 'number of query points, default 10', typeLabel: '[underline]{number}'},
{name: 'queries-files', alias: 'q', type: String,
description: 'CSV file with queries in the first row', typeLabel: '[underline]{file}'}];
{name: 'server', alias: 's', type: ServerDetails, defaultValue: ServerDetails('localhost:5000'), description: 'OSRM routing server', typeLabel: '{underline hostname[:port]}'},
{name: 'path', alias: 'p', type: String, defaultValue: '/route/v1/driving/{};{}', description: 'OSRM query path with \\{\\} coordinate placeholders, default /route/v2/driving/\\{\\};\\{\\}', typeLabel: '{underline path}'},
{name: 'filter', alias: 'f', type: String, defaultValue: ['$.routes[0].weight'], multiple: true, description: 'JSONPath filters, default "$.routes[0].weight"', typeLabel: '{underline filter}'},
{name: 'bounding-box', alias: 'b', type: BoundingBox, defaultValue: BoundingBox('5.86442,47.2654,15.0508,55.1478'), multiple: true, description: 'queries bounding box, default "5.86442,47.2654,15.0508,55.1478"', typeLabel: '{underline west,south,east,north}'},
{name: 'max-sockets', alias: 'm', type: Number, defaultValue: 1, description: 'how many concurrent sockets the agent can have open per origin, default 1', typeLabel: '{underline number}'},
{name: 'number', alias: 'n', type: Number, defaultValue: 10, description: 'number of query points, default 10', typeLabel: '{underline number}'},
{name: 'queries-files', alias: 'q', type: String, description: 'CSV file with queries in the first row', typeLabel: '{underline file}'},
];
const options = cla(optionsList);
if (options.help) {
const banner =
String.raw` ____ _______ __ ___ ___ __ ___ ___ _________ ` + '\n' +
String.raw` / __ \/ __/ _ \/ |/ / / _ \/ / / / |/ / |/ / __/ _ \ ` + '\n' +
String.raw`/ /_/ /\ \/ , _/ /|_/ / / , _/ /_/ / / / _// , _/ ` + '\n' +
String.raw`\____/___/_/|_/_/ /_/ /_/|_|\____/_/|_/_/|_/___/_/|_| `;
const banner =`\
____ _______ __ ______ __ ___ ___ _________
/ __ \\\\/ __/ _ \\\\/ |/ / _ \\\\/ / / / |/ / |/ / __/ _ \\\\
/ /_/ /\\\\ \\\\/ , _/ /|_/ / , _/ /_/ / / / _// , _/
\\\\____/___/_/|_/_/ /_/_/|_|\\\\____/_/|_/_/|_/___/_/|_|`;
const usage = clu([
{ content: ansi.format(banner, 'green'), raw: true },
{ header: 'Run OSRM queries and collect results'/*, content: 'Generates something [italic]{very} important.'*/ },
Expand Down

0 comments on commit 0a1d190

Please sign in to comment.