From 40d3c2b907e094c970b03f8b1677f56d4c6645fb Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Wed, 21 Oct 2015 08:50:42 -0400 Subject: [PATCH] nitx: rename option `--query` to `--command` `-q` conflicts with `--quiet` from toolcontext. Moreover, the documentation talks about commands, not queries, so this unify the vocabulary. Signed-off-by: Jean Privat --- share/man/nitx.md | 6 +++--- src/nitx.nit | 6 +++--- tests/nitx.args | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/share/man/nitx.md b/share/man/nitx.md index 1d2f086..fc2f8e6 100644 --- a/share/man/nitx.md +++ b/share/man/nitx.md @@ -46,10 +46,10 @@ exit the tool. # OPTIONS -### `-q`, `--query` -Nitx query to perform. +### `-c`, `--command` +Nitx command to perform. -Execute a query, display results in the console, then quit. +Execute a command, display results in the console, then quit. ### `--no-attributes` Ignore the attributes. diff --git a/src/nitx.nit b/src/nitx.nit index cf5ab95..1c8be5f 100644 --- a/src/nitx.nit +++ b/src/nitx.nit @@ -32,9 +32,9 @@ redef class ToolContext var docx: Phase = new NitxPhase(self, null) # Used to shortcut the prompt and display directly the result in console. - var opt_query = new OptionString("Nitx query to perform", "-q", "--query") + var opt_command = new OptionString("Nitx command to perform", "-c", "--command") - init do option_context.add_option opt_query + init do option_context.add_option opt_command end # Nitx phase explores the model and prepares the console rendering. @@ -58,7 +58,7 @@ private class NitxPhase # start nitx var nitx = new Nitx(toolcontext, doc) - var q = toolcontext.opt_query.value + var q = toolcontext.opt_command.value if q != null then # shortcut prompt print "" nitx.do_query(q) diff --git a/tests/nitx.args b/tests/nitx.args index 7f05220..79da3ab 100644 --- a/tests/nitx.args +++ b/tests/nitx.args @@ -1,3 +1,3 @@ -base_simple3.nit -q A -base_simple3.nit -q foo -base_simple3.nit -q base_simple3 +base_simple3.nit -c A +base_simple3.nit -c foo +base_simple3.nit -c base_simple3 -- 1.7.9.5