mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-09-28 20:23:36 +00:00
Add standalone mode
This commit is contained in:
parent
1c3a2c82e6
commit
f06e5b4fd8
|
@ -42,6 +42,7 @@ public class Application : Gtk.Application
|
|||
public static bool quit = false;
|
||||
public static string activity;
|
||||
public static bool no_wd = false;
|
||||
public static bool standalone = false;
|
||||
|
||||
public static ApplicationCommandLine command_line;
|
||||
|
||||
|
@ -64,6 +65,9 @@ public class Application : Gtk.Application
|
|||
{"no-wd", 0, 0, OptionArg.NONE,
|
||||
ref no_wd, N_("Do not try to load a repository from the current working directory"), null},
|
||||
|
||||
{"standalone", 0, 0, OptionArg.NONE,
|
||||
ref standalone, N_("Run gitg in standalone mode"), null},
|
||||
|
||||
{null}
|
||||
};
|
||||
}
|
||||
|
@ -148,6 +152,11 @@ public class Application : Gtk.Application
|
|||
return true;
|
||||
}
|
||||
|
||||
if (Options.standalone)
|
||||
{
|
||||
set_flags(get_flags() | ApplicationFlags.NON_UNIQUE);
|
||||
}
|
||||
|
||||
if (Options.quit)
|
||||
{
|
||||
exit_status = 0;
|
||||
|
|
15
test.vala
Executable file
15
test.vala
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env vala
|
||||
message ("hello world!");
|
||||
|
||||
Regex regexp = new Regex(".*(?:\\s|\\R)*(?P<message>(?:.|\\R)*?)\\s*$");
|
||||
|
||||
|
||||
var m = "hello world\r\n Riti toti.\r\nasdf adfa \r\n a \r\n ";
|
||||
MatchInfo minfo;
|
||||
|
||||
if (regexp.match(m, 0, out minfo))
|
||||
{
|
||||
var mes = minfo.fetch_named("message");
|
||||
message(":"+mes+":");
|
||||
}
|
||||
|
Loading…
Reference in a new issue