Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
b98b90163d | |||
daa6312aea | |||
7f2dab091f | |||
dd293875c4 |
10
README.md
10
README.md
@ -35,7 +35,7 @@ mytool function argument1 argument2 --option1 -o2 option2Value
|
|||||||
* option1 is a longform option you can add (like --message for message)
|
* option1 is a longform option you can add (like --message for message)
|
||||||
* optionValue is the referenced option value (like a commit message)
|
* optionValue is the referenced option value (like a commit message)
|
||||||
|
|
||||||
```typescript
|
```javascript
|
||||||
import {Smartcli} from "smartcli"
|
import {Smartcli} from "smartcli"
|
||||||
mySmartcli = new Smartcli();
|
mySmartcli = new Smartcli();
|
||||||
mySmartcli.standardTask()
|
mySmartcli.standardTask()
|
||||||
@ -47,6 +47,14 @@ mySmartcli.addCommand({commandname: 'install'})
|
|||||||
.then(argvArg => {
|
.then(argvArg => {
|
||||||
// do something if program is called with command "install"
|
// do something if program is called with command "install"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mySmartcli.addVersion('1.0.0') // -v and --version options will display the specified version in the terminal
|
||||||
|
|
||||||
|
mySmartCli.addHelp({ // is triggered by help command and --help option
|
||||||
|
helpText: 'some help text to print' // the helpText to display
|
||||||
|
})
|
||||||
|
|
||||||
|
mySmartcli.startParse() // starts the evaluation and fullfills or rejects promises.
|
||||||
```
|
```
|
||||||
|
|
||||||
[](https://push.rocks)
|
[](https://push.rocks)
|
||||||
|
11
package.json
11
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "smartcli",
|
"name": "smartcli",
|
||||||
"version": "1.0.13",
|
"version": "1.0.15",
|
||||||
"description": "nodejs wrapper for CLI related tasks",
|
"description": "nodejs wrapper for CLI related tasks",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
@ -17,11 +17,12 @@
|
|||||||
"url": "https://gitlab.com/pushrocks/smartcli.git"
|
"url": "https://gitlab.com/pushrocks/smartcli.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"json",
|
"cli",
|
||||||
"jade",
|
"promise",
|
||||||
"template"
|
"task",
|
||||||
|
"push.rocks"
|
||||||
],
|
],
|
||||||
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
"author": "Lossless GmbH <office@lossless.com> (https://lossless.com)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitlab.com/pushrocks/smartcli/issues"
|
"url": "https://gitlab.com/pushrocks/smartcli/issues"
|
||||||
|
Reference in New Issue
Block a user