-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
23 changed files
with
455 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
interface UsageProperty {} | ||
|
||
export {UsageProperty}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import {Usage} from "./usage"; | ||
import {UsageProperty} from '../interface/UsageProperty'; | ||
|
||
/** | ||
* The command with name, description and usage, if they exist | ||
*/ | ||
class Command implements UsageProperty { | ||
|
||
/** | ||
* The command name | ||
* @type {string} | ||
*/ | ||
command: string | undefined; | ||
|
||
/** | ||
* The command description | ||
* @type {?string | undefined} | ||
*/ | ||
description?: string | undefined; | ||
|
||
/** | ||
* The commands usage | ||
* @type {?Usage | undefined} | ||
*/ | ||
usage?: Usage | undefined; | ||
|
||
/** | ||
* @constructor | ||
* @param {string} command - The command name | ||
* @param {string | undefined } descripton - The command description | ||
* @param {Usage | undefined} usage - The command usage | ||
*/ | ||
constructor( | ||
command: string | undefined, | ||
descripton: string | undefined, | ||
usage: Usage | undefined | ||
) { | ||
this.command = command; | ||
this.usage = usage; | ||
this.description = descripton; | ||
} | ||
|
||
/** | ||
* Create Command object with name, description and usage | ||
* @param {string} command - The command name | ||
* @param {string | undefined } [descripton="undefined"] - The command description | ||
* @param {Usage | undefined} [usage="undefined"] - The command usage | ||
* @returns {Command} - The command object | ||
*/ | ||
static create( | ||
command: string | undefined, | ||
description: string | undefined = undefined, | ||
usage: Usage | undefined = undefined | ||
) { | ||
return new Command(command, description, usage); | ||
} | ||
} | ||
|
||
export { Command }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.