Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit ec12908

Browse files
committed
fix for broken host help and leftover timeline activation help
Fixes #868 Fixes #869
1 parent 50014a1 commit ec12908

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

app/content/js/repl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ self.exec = (commandUntrimmed, execOptions) => {
757757
if (usage && usage.strict) { // strict: command wants *us* to enforce conformance
758758
// required and optional parameters
759759
const { strict:cmd, required=[], oneof=[], optional:_optional=[] } = usage,
760-
optLikeOneOfs = oneof.filter(({name}) => name.charAt(0) === '-'), // some one-ofs might be of the form --foo
760+
optLikeOneOfs = oneof.filter(({command,name=command}) => name.charAt(0) === '-'), // some one-ofs might be of the form --foo
761761
positionalConsumers = _optional.filter(({name, alias, consumesPositional}) => consumesPositional && (parsedOptions[unflag(name)] || parsedOptions[unflag(alias)])),
762762
optional = builtInOptions.concat(_optional).concat(optLikeOneOfs),
763763
positionalOptionals = optional.filter(({positional}) => positional),

app/content/js/usage-error.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ const format = (message, options={}) => {
131131
const { command, docs, title, breadcrumb=title||command, header=docs&&`${docs}.`, example, detailedExample, sampleInputs,
132132
commandPrefix, commandPrefixNotNeeded,
133133
available, parents=[], related, required, optional, oneof } = usage,
134-
outerCommandPrefix = commandPrefix
134+
outerCommandPrefix = commandPrefix,
135+
outerCommand = command
135136

136137
// the return value will be `result`; we will populate it with
137138
// those fields now; `body` is the flex-wrap portion of the
@@ -339,7 +340,7 @@ const format = (message, options={}) => {
339340

340341
// fields of the row model
341342
// debug('row', rowData)
342-
const { commandPrefix=outerCommandPrefix, command=commandPrefix, name=command, label=name,
343+
const { commandPrefix=outerCommandPrefix, command=outerCommand, name=command, label=name,
343344
alias, numeric, aliases=[alias], hidden=false, advanced=false,
344345
available,
345346
example=numeric&&'N', dir:isDir=available||false,
@@ -360,7 +361,7 @@ const format = (message, options={}) => {
360361
allowedPart = allowed && smaller(span(undefined))
361362

362363
// for repl.exec,
363-
const commandForExec = alias => `${commandPrefix && !commandPrefixNotNeeded ? commandPrefix + ' ' : ''}${alias}`
364+
const commandForExec = (alias, cmd='') => `${commandPrefix && !commandPrefixNotNeeded ? commandPrefix + ' ' : ''}${alias} ${cmd}`
364365

365366
row.className = 'log-line entity'
366367
cmdCell.className = 'log-field'
@@ -412,7 +413,10 @@ const format = (message, options={}) => {
412413
if (partial) {
413414
return repl.partial(commandForExec(alias)(command) + `${partial === true ? '' : ' ' + partial}`)
414415
} else {
415-
return repl.pexec(commandForExec(command))
416+
console.error('CP', commandPrefix)
417+
console.error('CCC', command)
418+
console.error('NNN', name)
419+
return repl.pexec(commandForExec(command, name !== command ? name : undefined))
416420
}
417421
}
418422
}

app/plugins/modules/activation-visualizations/usage.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
const nRowsInViewport = 4
1919

2020
/** list of related commands */
21-
const all = ['summary', 'timeline', 'grid']
21+
const all = ['summary',
22+
//'timeline',
23+
'grid']
2224
const allExcept = cmd => all.filter(_ => _ !== cmd)
2325

2426
/** optional arguments */
@@ -40,7 +42,7 @@ const parents = ['visualize']
4042

4143
const header = {
4244
summary: 'Visualize the statistical distribution of activation latencies',
43-
timeline: 'Show activity over time',
45+
//timeline: 'Show activity over time',
4446
grid: 'Show a large number of recent activations in a grid view'
4547
}
4648

@@ -56,7 +58,7 @@ module.exports = {
5658
commandPrefix: 'visualize',
5759
commandPrefixNotNeeded: true,
5860
available: [{ command: 'summary', docs: header.summary },
59-
{ command: 'timeline', docs: header.timeline },
61+
//{ command: 'timeline', docs: header.timeline },
6062
{ command: 'grid', docs: header.grid }],
6163
related: ['wsk activation', 'composer session']
6264
},
@@ -75,7 +77,7 @@ module.exports = {
7577
related: allExcept('summary')
7678
},
7779

78-
timeline: {
80+
/*timeline: {
7981
strict: 'timeline',
8082
command: 'timeline',
8183
nRowsInViewport,
@@ -85,7 +87,7 @@ module.exports = {
8587
optional: optional.concat([{ name: '--theme', docs: 'a color theme to use' }]),
8688
parents,
8789
related: allExcept('timeline')
88-
},
90+
},*/
8991

9092
grid: {
9193
strict: 'grid',

app/plugins/ui/commands/auth.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ const usage = {
9090
nRowsInViewport: 5,
9191
oneof: [
9292
{ name: 'local', docs: 'Use a local OpenWhisk installation' },
93-
{ name: 'us-south', docs: 'Use the IBM Cloud Dallas installation' },
94-
{ name: 'eu-gb', docs: 'Use the IBM Cloud London installation' },
95-
{ name: 'eu-de', docs: 'Use the IBM Cloud Frankrut installation' },
96-
{ name: 'hostname', docs: 'Use a given hostname or IP address' }
93+
{ command: 'us-south', docs: 'Use the IBM Cloud Dallas installation' },
94+
{ command: 'eu-gb', docs: 'Use the IBM Cloud London installation' },
95+
{ command: 'eu-de', docs: 'Use the IBM Cloud Frankrut installation' },
96+
{ command: 'hostname', docs: 'Use a given hostname or IP address' }
9797
],
9898
parents: ['host']
9999
}

0 commit comments

Comments
 (0)