Skip to content

Commit

Permalink
polish usage section
Browse files Browse the repository at this point in the history
  • Loading branch information
FRosner committed Oct 4, 2015
1 parent 1413b2f commit dc7c772
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ libraryDependencies += "com.github.FRosner" % "repl-helper" % "x.y.z"

### Use It!

Define the `@Help` annotation on your method like so:

```scala
object MyReplUtil {

@Help(
category = "Math",
shortDescription = "Add two numbers",
longDescription = "Add two numbers. Integer overflow might occur!",
parameters = "a: Int, b: Int"
)
def add(a: Int, b: Int) = a + b

}
```

Create a helper instance of your class:

```scala
val myHelper = Helper(MyReplUtil.getClass)
```

Print help to a `PrintStream` of your choice. You can either print all available methods or request detailed help for a particular one:

```scala
myHelper.printAllMethods(System.out)
myHelper.printMethods("add", System.out)
```
1. Define the `@Help` annotation on your methods.

```scala
object MyReplUtil {
@Help(
category = "Math",
shortDescription = "Add two numbers",
longDescription = "Add two numbers. Integer overflow might occur!",
parameters = "a: Int, b: Int"
)
def add(a: Int, b: Int) = a + b
}
```

2. Create a helper instance of your class.

```scala
val myHelper = Helper(MyReplUtil.getClass)
```

3. Print help to a `PrintStream` of your choice. You can either print all available methods or request detailed help for a particular one.

```scala
myHelper.printAllMethods(System.out)
myHelper.printMethods("add", System.out)
```

0 comments on commit dc7c772

Please sign in to comment.