Skip to content

Commit ca2c409

Browse files
committed
Merge pull request #34 from FunnelEnvy/helpnoargs
Show help when no args passed
2 parents 08e89ad + fa24172 commit ca2c409

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Optimizely Command Line Interface
22

3-
Optimizely-CLI (optcli) is a command line tool that lets developers build experiments faster by using the sofware tools you already love and publish to Optimizely when ready. We build a lot of tests at [FunnelEnvy](http://www.funnelenvy.com) and found that (being stubborn engineers) we were more comfortable using our source editors and Git to develop locally - and this had a *significant* positive impact on our test velocity.
3+
Optimizely-CLI (optcli) is a command line tool that lets developers build experiments faster by using the sofware tools you already love and publish to Optimizely when ready. We build a lot of tests at [FunnelEnvy](http://www.funnelenvy.com) and found that (being stubborn engineers) we were more comfortable using our source editors and Git to develop locally - and this had a *significant* positive impact on our test velocity.
44

55
Optimizely-cli includes a command line executable that also integrates with either the[Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en) (Google Chrome) or [Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) (Firefox) extensions for local development / preview and the Optimizely API for publishing tests.
66

@@ -21,8 +21,9 @@ You'll need to have [node.js](http://nodejs.org/) installed locally to run `optc
2121
## Quickstart
2222

2323
```
24-
optcli help
24+
optcli
2525
```
26+
2627
View available commands
2728

2829
```

bin/optcli.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@ program
5757

5858
program
5959
.command("push-variation <path>")
60-
.description("Push a variation to Optimizely (experiment must be pushed first)")
60+
.description(
61+
"Push a variation to Optimizely (experiment must be pushed first)")
6162
.action(loadCommand("push-variation"));
6263

64+
//Show help if no arguments are passed
65+
if (!process.argv.slice(2).length) {
66+
program._name = process.argv[1];
67+
program._name = program._name.substr(program._name.lastIndexOf("/") + 1);
68+
program.outputHelp();
69+
}
70+
6371
program.parse(process.argv);

0 commit comments

Comments
 (0)