Skip to content
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

Merged
merged 4 commits into from
Sep 10, 2021

Conversation

peternhale
Copy link
Contributor

@W-9791511@ add custom help class

@W-9791511@ add custom help class
@@ -29,6 +29,7 @@
"state": "beta",
"topicSeparator": " ",
"commands": "./dist/commands",
"helpClass": "./dist/help/sfHelp.js",
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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[] {
Copy link
Contributor Author

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[] = [
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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

mdonnalley
mdonnalley previously approved these changes Sep 9, 2021
RodEsp
RodEsp previously approved these changes Sep 9, 2021
@peternhale peternhale dismissed stale reviews from RodEsp and mdonnalley via 83c0a5c September 10, 2021 14:56
@peternhale peternhale merged commit ea7fe61 into main Sep 10, 2021
@peternhale peternhale deleted the phale/W-9791511-help branch September 10, 2021 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants