DocsCommand
Extends:
The command invoked when running "docs". Handles the options --cli and --browser.
Test:
Static Member Summary
| Static Public Members | ||
| public static get |
Base URL of the hosted API documentation. |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(name: string, description: string) Creates a new DocsCommand with the specified name and description. |
|
Method Summary
| Public Methods | ||
| public |
addressToOpen(cli: AtSCMCli): {address: string, isPath: boolean} Returns the path or url to open. |
|
| public |
localDocsPath(cli: AtSCMCli): string Returns the path to the local api docs. |
|
| public |
remoteDocsUrl(cli: AtSCMCli): string Returns the URL of the remote api docs. |
|
| public |
requiresEnvironment(cli: AtSCMCli): boolean Returns |
|
| public |
Opens the requested docs in the requested browser. |
|
Inherited Summary
| From class Command | ||
| public get |
The minimum and maximum number of (non-option) arguments the command handles. |
|
| public get |
The options available for the command. |
|
| public get |
If an error should be thrown for unknown arguments. |
|
| public get |
Returns the usage string for the command. |
|
| public |
The command descriptions. |
|
| public |
The command's name. |
|
| private |
The command's raw options. |
|
| public |
requiresEnvironment(cli: AtSCMCli): boolean Returns |
|
| public |
Runs the command with the current Cli instance. |
|
Static Public Members
Public Constructors
public constructor(name: string, description: string) source
Creates a new DocsCommand with the specified name and description.
Override:
Command#constructorPublic Methods
public addressToOpen(cli: AtSCMCli): {address: string, isPath: boolean} source
Returns the path or url to open. This is resolved in the following way:
- If
--remoteis passed, always return the URL of the hosted docs of atscm-cli or atscm based on the--clioption passed. - If
--cliis passed, always return the path to the local atscm-cli docs. - Otherwise, check if a local module was found:
- If true return the local module docs path,
- else return the URL of the hosted atscm docs.
Params:
| Name | Type | Attribute | Description |
| cli | AtSCMCli | The calling Cli instance. |
public localDocsPath(cli: AtSCMCli): string source
Returns the path to the local api docs.
Params:
| Name | Type | Attribute | Description |
| cli | AtSCMCli | The current Cli instance. |
public remoteDocsUrl(cli: AtSCMCli): string source
Returns the URL of the remote api docs.
Params:
| Name | Type | Attribute | Description |
| cli | AtSCMCli | The current Cli instance. |
public requiresEnvironment(cli: AtSCMCli): boolean source
Returns false if the --cli option is used.
Override:
Command#requiresEnvironmentParams:
| Name | Type | Attribute | Description |
| cli | AtSCMCli | The current cli instance. |
public run(cli: AtSCMCli): Promise source
Opens the requested docs in the requested browser.
Override:
Command#runParams:
| Name | Type | Attribute | Description |
| cli | AtSCMCli | The current Cli instance. |
