-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add help class to display additional cmd help #52
Conversation
@W-9791511@ add custom help class
@@ -29,6 +29,7 @@ | |||
"state": "beta", | |||
"topicSeparator": " ", | |||
"commands": "./dist/commands", | |||
"helpClass": "./dist/help/sfHelp.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name the help class for oclif
import { SfCommandInterface } from '@salesforce/command'; | ||
type SectionType = { header: string; generate: HelpSectionRenderer }; | ||
|
||
export class SfCommandHelp extends CommandHelp { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is responsible for collecting the help sections to display
super(command, config, opts); | ||
} | ||
|
||
protected sections(): SectionType[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Override base class sections
|
||
protected sections(): SectionType[] { | ||
const sections = super.sections(); | ||
const additionaSfSections: SectionType[] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sf additional sections
import { CommandHelp, Help } from '@oclif/core'; | ||
import { SfCommandHelp } from './sfCommandHelp'; | ||
|
||
export default class SfHelp extends Help { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to specify SfCommandHelp as the class to call
@W-9791511@ add custom help class