[geary/wip/768422-namespace-support: 3/6] Allow "" to be used by geary-console as an empty string arg.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/768422-namespace-support: 3/6] Allow "" to be used by geary-console as an empty string arg.
- Date: Thu, 2 Nov 2017 07:06:39 +0000 (UTC)
commit 93d63e696655823aec7cfd34d6f9910a0d97d087
Author: Michael James Gratton <mike vee net>
Date: Thu Nov 2 16:44:48 2017 +1100
Allow "" to be used by geary-console as an empty string arg.
src/console/main.vala | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/console/main.vala b/src/console/main.vala
index 179dfd4..f7b7037 100644
--- a/src/console/main.vala
+++ b/src/console/main.vala
@@ -108,25 +108,27 @@ class ImapConsole : Gtk.Window {
"preview",
"close"
};
-
+
private void exec(string input) {
string[] lines = input.strip().split(";");
foreach (string line in lines) {
string[] tokens = line.strip().split(" ");
if (tokens.length == 0)
continue;
-
+
string cmd = tokens[0].strip().down();
-
string[] args = new string[0];
for (int ctr = 1; ctr < tokens.length; ctr++) {
string arg = tokens[ctr].strip();
- if (!Geary.String.is_empty(arg))
+ if (arg == "\"\"") {
+ args += "";
+ } else if (!Geary.String.is_empty(arg)) {
args += arg;
+ }
}
-
+
clear_status();
-
+
// TODO: Need to break out the command delegates into their own objects with the
// human command-names and usage and exec()'s and such; this isn't a long-term approach
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]