feat: help

This commit is contained in:
wss-git 2021-06-10 09:37:48 +08:00
parent 1c8d2ab139
commit f2fffa8a26
2 changed files with 26 additions and 12 deletions

View File

@ -1,11 +1,11 @@
export default [ export default [
{ {
header: 'Description', header: 'Invoke',
content: 'Remote Invoke', content: 'Invoke/trigger online functions.',
}, },
{ {
header: 'Usage', header: 'Usage',
content: '$ fc-remote-invoke invoke <options>', content: '$ s invoke <options>',
}, },
{ {
header: 'Options', header: 'Options',
@ -36,17 +36,17 @@ export default [
}, },
{ {
name: 'region', name: 'region',
description: 'Pass in region in cli mode', description: 'Specify region in cli mode',
type: String, type: String,
}, },
{ {
name: 'service-name', name: 'service-name',
description: 'Pass in service name in cli mode', description: 'Specify service name in cli mode',
type: String, type: String,
}, },
{ {
name: 'function-name', name: 'function-name',
description: 'Pass in function name in cli mode', description: 'Specify function name in cli mode',
type: String, type: String,
}, },
], ],
@ -54,9 +54,15 @@ export default [
{ {
header: 'Global Options', header: 'Global Options',
optionList: [ optionList: [
{
name: 'access',
description: 'Specify key alias.',
alias: 'a',
type: Boolean,
},
{ {
name: 'help', name: 'help',
description: 'fc-remote-invoke help for command', description: 'fc-remote-invoke help for command.',
alias: 'h', alias: 'h',
type: Boolean, type: Boolean,
}, },
@ -71,11 +77,20 @@ export default [
], ],
}, },
{ {
header: 'Examples with Cli', header: 'Examples with CLI',
content: [ content: [
'$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event [payload]', {
'$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event-file [path]', example: '$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event [payload]',
'$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event-stdin', },
{
example: '$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event-file [path]',
},
{
example: '$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event-stdin',
},
{
example: 'You also can refer to the usage of fc-api and execute [s cli fc-api -h] for help. $ s cli fc-api invokeFunction -h',
},
], ],
}, },
] ]

View File

@ -106,7 +106,6 @@ export default class FcRemoteInvoke {
await this.report('fc-remote-invoke', 'invoke', credentials?.AccountID); await this.report('fc-remote-invoke', 'invoke', credentials?.AccountID);
if (isHelp) { if (isHelp) {
console.log('??');
core.help(HELP); core.help(HELP);
return; return;
} }