[gnome-terminal] gterminal: Fix completion argument parsing
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] gterminal: Fix completion argument parsing
- Date: Tue, 14 Jul 2015 17:38:00 +0000 (UTC)
commit 1aa926053d25bef6e80ee4e698ee8174dce69a0e
Author: Christian Persch <chpe gnome org>
Date: Tue Jul 14 19:37:28 2015 +0200
gterminal: Fix completion argument parsing
src/gterminal.vala | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/gterminal.vala b/src/gterminal.vala
index 5422a18..f1835eb 100644
--- a/src/gterminal.vala
+++ b/src/gterminal.vala
@@ -484,8 +484,10 @@ namespace GTerminal
if (GlobalOptions.get_complete ()) {
/* Try to complete */
- string? prefix = argv.length > 2 ? argv[2] : null;
+ string? prefix = argv.length > 0 ? argv[0] : null;
for (uint i = 0; i < commands.length; i++) {
+ if (commands[i].verb[0] == '_')
+ continue; /* skip hidden commands */
if (prefix == null || commands[i].verb.has_prefix (prefix))
Output.print ("%s\n", commands[i].verb);
}
@@ -519,8 +521,8 @@ namespace GTerminal
if (argv[0] == "run" && OpenOptions.argv_post == null)
throw new OptionError.BAD_VALUE (_("'%s' needs the command to run as arguments after '--'"),
argv[0]);
-
- var receiver = create_terminal ();
+ else if (argv[0] == "shell" && OpenOptions.argv_post != null)
+ throw new OptionError.BAD_VALUE (_("Extraneous arguments after '--'"));
var builder = new GLib.VariantBuilder (VariantType.TUPLE);
builder.open (VariantType.VARDICT); {
@@ -531,6 +533,7 @@ namespace GTerminal
} builder.close ();
builder.add_value (new Variant.bytestring_array (OpenOptions.argv_post));
+ var receiver = create_terminal ();
receiver.call_with_unix_fd_list_sync ("Exec" /* (a{sv}aay) */,
builder.end (),
DBusCallFlags.NO_AUTO_START, -1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]