diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-11-01 23:28:08 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-11-01 23:28:08 +0100 |
commit | 1b8eb3b19a8793fb225bdc785ebc10bea63bbb36 (patch) | |
tree | 54cd7fe526535df88c9ee1faa10aa3fce6f1a076 /sinksh/syntaxtree.h | |
parent | e1a3aebafca9a9447a393100db4fc45943551630 (diff) | |
download | sink-1b8eb3b19a8793fb225bdc785ebc10bea63bbb36.tar.gz sink-1b8eb3b19a8793fb225bdc785ebc10bea63bbb36.zip |
Ensure we get a return code
Diffstat (limited to 'sinksh/syntaxtree.h')
-rw-r--r-- | sinksh/syntaxtree.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sinksh/syntaxtree.h b/sinksh/syntaxtree.h index 8fbbd01..ce28548 100644 --- a/sinksh/syntaxtree.h +++ b/sinksh/syntaxtree.h | |||
@@ -45,7 +45,16 @@ public: | |||
45 | QString keyword; | 45 | QString keyword; |
46 | QString help; | 46 | QString help; |
47 | Interactivity interactivity; | 47 | Interactivity interactivity; |
48 | std::function<bool(const QStringList &, State &)> lambda; | 48 | |
49 | /** | ||
50 | * This function will be called to execute the command. | ||
51 | * | ||
52 | * @arguments: The command arguments | ||
53 | * @state: The state object | ||
54 | * @return: Return true for success and false for error. If the command is event driven, returning false will not start an event loop and abort immediately. | ||
55 | * If the command is not event driven, returning false will set the exit code to 1. | ||
56 | */ | ||
57 | std::function<bool(const QStringList &arguments, State &state)> lambda; | ||
49 | std::function<QStringList(const QStringList &, const QString &, State &state)> completer; | 58 | std::function<QStringList(const QStringList &, const QString &, State &state)> completer; |
50 | 59 | ||
51 | QVector<Syntax> children; | 60 | QVector<Syntax> children; |