Skip to content

Commit

Permalink
Fix CLI naming in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dpikt committed Nov 26, 2019
1 parent 2dfb71e commit c52c8c7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 44 deletions.
63 changes: 28 additions & 35 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

### Table of Contents

- [main][1]
- [Parameters][2]
- [load][3]
- [Parameters][4]
- [Examples][5]
- [read][6]
- [Parameters][7]
- [Examples][8]
- [requireKeys][9]
- [Parameters][10]
- [Examples][11]

## main
- [CLI][1]
- [load][2]
- [Parameters][3]
- [Examples][4]
- [read][5]
- [Parameters][6]
- [Examples][7]
- [requireKeys][8]
- [Parameters][9]
- [Examples][10]

## CLI

This module exposes a CLI that can be run with `yarn figaro`.

Expand All @@ -26,14 +25,10 @@ For more information:

`$ yarn figaro -h`

### Parameters

- `args` (optional, default `process.argv`)

## load

A function that loads env variables into `process.env`.
Internally calls [read][6] and merges the result into `process.env`.
Internally calls [read][5] and merges the result into `process.env`.

**Options**

Expand All @@ -44,7 +39,7 @@ Internally calls [read][6] and merges the result into `process.env`.

### Parameters

- `options` **[object][12]** Options for the function as specified above.
- `options` **[object][11]** Options for the function as specified above.

### Examples

Expand Down Expand Up @@ -81,7 +76,7 @@ The latter will only be loaded if the current environment matches the environmen

### Parameters

- `options` **[object][12]** Options for the function as specified above.
- `options` **[object][11]** Options for the function as specified above.

### Examples

Expand Down Expand Up @@ -116,7 +111,7 @@ If they exist in `process.env`, it returns `true`; if not, it throws an exceptio

### Parameters

- `keys` **...[string][13]** The required keys
- `keys` **...[string][12]** The required keys

### Examples

Expand All @@ -130,28 +125,26 @@ if (requireKeys('MY_KEY', 'ANOTHER_KEY')) {
*
```

[1]: #main

[2]: #parameters
[1]: #cli

[3]: #load
[2]: #load

[4]: #parameters-1
[3]: #parameters

[5]: #examples
[4]: #examples

[6]: #read
[5]: #read

[7]: #parameters-2
[6]: #parameters-1

[8]: #examples-1
[7]: #examples-1

[9]: #requirekeys
[8]: #requirekeys

[10]: #parameters-3
[9]: #parameters-2

[11]: #examples-2
[10]: #examples-2

[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "figaro-js",
"version": "3.0.2",
"version": "3.0.3",
"description": "Env variable management in JS",
"main": "lib/index.js",
"bin": {
Expand Down
17 changes: 9 additions & 8 deletions src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ import registerHerokuCommands from './heroku'

/**
* This module exposes a CLI that can be run with `yarn figaro`.
*
*
* Using the `heroku:set` command, you can set values from your configuration file all at once:
*
*
* `$ yarn figaro heroku:set -e production`
*
*
* For more information:
*
*
* `$ yarn figaro -h`
*
*
* @name CLI
**/
* @type Function
**/

function main (args=process.argv) {
function main(args = process.argv) {
const program = new Command()
registerHerokuCommands(program)
return program.parse(args)
Expand All @@ -26,4 +27,4 @@ function main (args=process.argv) {
// Exported for testing
export default main

if (!module.parent) main()
if (!module.parent) main()

0 comments on commit c52c8c7

Please sign in to comment.