-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add flag and add flags is supported, but is used for generate help documentation mostly, not for retrieving values - TODO: global flag support is partly implemented, trace back parent command to get all the global flags is needed.
- Loading branch information
Showing
4 changed files
with
120 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Created by at15 on 2016/9/11. | ||
*/ | ||
'use strict'; | ||
|
||
/** | ||
* @property name {string} | ||
* @property description {string} | ||
* @property defaultValue {string|number|boolean} | ||
* @property alias {string} | ||
*/ | ||
class Flag { | ||
constructor(name, description, defaultValue) { | ||
this.name = name; | ||
this.description = description; | ||
this.defaultValue = defaultValue; | ||
this.alias = ''; | ||
this.global = false; | ||
} | ||
|
||
setAlias(alias) { | ||
this.alias = alias; | ||
} | ||
} | ||
|
||
module.exports = Flag; |
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