diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-02-06 15:29:25 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-02-06 15:29:25 +0100 |
commit | 58f6bfb1dc44fc0cf406df6ddb3aae0c3974ed03 (patch) | |
tree | e124cba307a57a4de72754654791d00eb48b2770 /examples/cross_todo/nim_commandline | |
parent | 19677a11b0680f5e76300608bc6dd61fd90229e8 (diff) | |
parent | 3941b8968cd44e4c629e29493fc4c8ffda5005f8 (diff) | |
download | Nim-58f6bfb1dc44fc0cf406df6ddb3aae0c3974ed03.tar.gz |
Merge branch 'devel' of github.com:nim-lang/Nim into devel
Diffstat (limited to 'examples/cross_todo/nim_commandline')
-rw-r--r-- | examples/cross_todo/nim_commandline/nimtodo.nim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/cross_todo/nim_commandline/nimtodo.nim b/examples/cross_todo/nim_commandline/nimtodo.nim index 4ab17e7a2..c8993b2c8 100644 --- a/examples/cross_todo/nim_commandline/nimtodo.nim +++ b/examples/cross_todo/nim_commandline/nimtodo.nim @@ -3,7 +3,7 @@ import backend, db_sqlite, os, parseopt, parseutils, strutils, times const - USAGE = """nimtodo - Nimrod cross platform todo manager + USAGE = """nimtodo - Nim cross platform todo manager Usage: nimtodo [command] [list options] @@ -191,11 +191,11 @@ proc parseCmdLine(): TParamConfig = abort("Used list options, but didn't specify the list command.", 10) -proc generateDatabaseRows(conn: TDbConn) = +proc generateDatabaseRows(conn: DbConn) = ## Adds some rows to the database ignoring errors. discard conn.addTodo(1, "Watch another random youtube video") discard conn.addTodo(2, "Train some starcraft moves for the league") - discard conn.addTodo(3, "Spread the word about Nimrod") + discard conn.addTodo(3, "Spread the word about Nim") discard conn.addTodo(4, "Give fruit superavit to neighbours") var todo = conn.addTodo(4, "Send tax form through snail mail") todo.isDone = true @@ -209,7 +209,7 @@ proc generateDatabaseRows(conn: TDbConn) = echo("Generated some entries, they were added to your database.") -proc listDatabaseContents(conn: TDbConn; listParams: TPagedParams) = +proc listDatabaseContents(conn: DbConn; listParams: TPagedParams) = ## Dumps the database contents formatted to the standard output. ## ## Pass the list/filter parameters parsed from the commandline. @@ -239,7 +239,7 @@ proc listDatabaseContents(conn: TDbConn; listParams: TPagedParams) = todo.text]) -proc deleteOneTodo(conn: TDbConn; todoId: int64) = +proc deleteOneTodo(conn: DbConn; todoId: int64) = ## Deletes a single todo entry from the database. let numDeleted = conn.deleteTodo(todoId) if numDeleted > 0: @@ -248,7 +248,7 @@ proc deleteOneTodo(conn: TDbConn; todoId: int64) = quit("Couldn't delete todo id " & $todoId, 11) -proc deleteAllTodos(conn: TDbConn) = +proc deleteAllTodos(conn: DbConn) = ## Deletes all the contents from the database. ## ## Note that it would be more optimal to issue a direct DELETE sql statement @@ -273,7 +273,7 @@ proc deleteAllTodos(conn: TDbConn) = echo("Deleted $1 todo entries from database." % $counter) -proc setTodoCheck(conn: TDbConn; todoId: int64; value: bool) = +proc setTodoCheck(conn: DbConn; todoId: int64; value: bool) = ## Changes the check state of a todo entry to the specified value. let newState = if value: "checked" else: "unchecked" @@ -293,7 +293,7 @@ proc setTodoCheck(conn: TDbConn; todoId: int64; value: bool) = quit("Error updating todo id $1 to $2." % [$todoId, newState]) -proc addTodo(conn: TDbConn; priority: int; tokens: seq[string]) = +proc addTodo(conn: DbConn; priority: int; tokens: seq[string]) = ## Adds to the database a todo with the specified priority. ## ## The tokens are joined as a single string using the space character. The |