Fix help text and banner
This commit is contained in:
parent
29db0c80d9
commit
0a1d1901cc
@ -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.'*/ },
|
||||
|
Loading…
Reference in New Issue
Block a user