From dc7c7721834cc9d538973f1d72a5f9c0b806d5cf Mon Sep 17 00:00:00 2001 From: Frank Rosner Date: Sun, 4 Oct 2015 23:12:31 +0200 Subject: [PATCH] polish usage section --- README.md | 56 +++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 8a49188..12b79f3 100644 --- a/README.md +++ b/README.md @@ -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) + ```