Skip to content

Commit

Permalink
📦 NEW: Spacing Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadawais committed Jul 9, 2020
1 parent ece26b7 commit 292bb27
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 46 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ module.exports = ({
}

if (desc) {
help += `${desc}`;
help += `${desc}${spacer}`;
}

// Usage.
help += `\n\n${greenInverse(` USAGE `)} ${spacer}`;
help += `${greenInverse(` USAGE `)} ${spacer}`;
help += chalk`{gray $} {green ${name}} {cyan <command>} {yellow [option]}`;

// Commands.
Expand Down
27 changes: 26 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,32 @@ npm install cli-meow-help
## Usage

```js
const cliMeowHelp = require('cli-meow-help');
const meow = require('meow');
const meowHelp = require('cli-meow-help');

const commands = {
new: {desc: `Creates a new user account`},
duplicate: {desc: `Duplicates a user account`}
};

const flags = {
random: {
desc: `Prints random data`,
type: 'boolean',
default: true
}
};

const helpText = meowHelp({
name: `cli-command`,
flags,
commands
});

meow(helpText, {flags});

// Now run `cli-command --help` to view the
// following auto formatted & generated help info.
```

<br>
Expand Down
51 changes: 8 additions & 43 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,22 @@
const meowHelp = require('.');

const commands = {
help: {
desc: `Print the help info`
}
new: {desc: `Creates a new user account`},
duplicate: {desc: `Duplicates a user account`}
};

const flags = {
minimal: {
type: 'boolean',
alias: 'm',
desc: `Qui consectetur blanditiis labore dolor.`
},
clear: {
type: 'boolean',
default: true,
desc: `Maiores quis amet nisi.`
},
bio: {
type: 'boolean',
default: true,
desc: `Prints bio`
},
social: {
random: {
desc: `Prints random data`,
type: 'boolean',
default: true,
desc: `Display social media links`
},
ad: {
type: 'boolean',
default: true,
desc: `Display an ad`
},
debug: {
type: 'boolean',
default: false,
alias: 'd',
desc: `Fugit quis commodi voluptatibus dolor`
},
version: {
type: 'boolean',
default: false,
alias: 'v',
desc: `Ut sit natus ipsa rerum est sed.`
default: true
}
};

const helpText = meowHelp({
name: `cli`,
desc: `This is a CLI that does this and that.`,
name: `cli-command`,
flags,
commands,
header: `This is a header`,
footer: `This is a footer`
commands
});

console.clear();
Expand Down

0 comments on commit 292bb27

Please sign in to comment.