Skip to content

Commit

Permalink
various fixes and tweaks relating to #46
Browse files Browse the repository at this point in the history
  - rename command_line.coffee
  - rebuild command.js using the correct CoffeeScript version
  - fix regular expression in formatters.coffee
  - fix stylistic inconsistencies
  - remove language directive from "code" block in CLI documentation
  - replace "tutor.js" with "tutor" in CLI documentation
  • Loading branch information
davidchambers committed Mar 30, 2013
1 parent 2eb85bf commit a2171e7
Show file tree
Hide file tree
Showing 20 changed files with 112 additions and 90 deletions.
54 changes: 26 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,6 @@ difficult.

Tutor is a simple JavaScript interface for Gatherer.

### CLI

Installing the package with the `-g` option gives you access to the `tutor` command.

```bash
$ tutor -h

Usage: tutor.js [options] [command]

Commands:

card <name> prints the information for a named card
set [options] <name> prints the information for the first page of the named set

Options:

-h, --help output usage information
-V, --version output the version number

$ tutor card 'Demonic Tutor'
Demonic Tutor {1}{B} Search your library for a card and put that card into your hand. Then shuffle your library.

$ tutor set 'Homelands' --page 3
Forget {U}{U} Target player discards two cards, then draws as many cards as he or she discarded this way.
Funeral March {1}{B}{B} Enchant creature When enchanted creature leaves the battlefield, its controller sacrifices a creature.
[etc]
```

### API

- [tutor.card](#tutorcard)
Expand Down Expand Up @@ -234,6 +206,32 @@ tutor.types (err, types) ->
# ]
```

### CLI

`npm install tutor --global` will make the `tutor` command available globally.

$ tutor --help

Usage: tutor [options] [command]

Commands:

card <name> output the named card's details
set [options] <name> output one page of cards from the named set

Options:

-h, --help output usage information
-V, --version output the version number

$ tutor card 'Demonic Tutor'
Demonic Tutor {1}{B} Search your library for a card and put that card into your hand. Then shuffle your library.

$ tutor set 'Homelands' --page 3
Forget {U}{U} Target player discards two cards, then draws as many cards as he or she discarded this way.
Funeral March {1}{B}{B} Enchant creature When enchanted creature leaves the battlefield, its controller sacrifices a creature.
...

### Running the tests

make fixtures
Expand Down
4 changes: 1 addition & 3 deletions bin/tutor
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env node


require('../lib/command_line').parse(process.argv);

require('../lib/command').parse(process.argv);
12 changes: 6 additions & 6 deletions lib/command_line.js → lib/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/entities.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions lib/formatters.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions lib/gatherer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion lib/gatherer/card.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion lib/gatherer/languages.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lib/gatherer/printings.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a2171e7

Please sign in to comment.