Skip to content

Instantly share code, notes, and snippets.

@codebrainz
Created June 10, 2017 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codebrainz/71d761e2cfd7e7519106ce4f731dd5ee to your computer and use it in GitHub Desktop.
Save codebrainz/71d761e2cfd7e7519106ce4f731dd5ee to your computer and use it in GitHub Desktop.
diff --git a/src/libmain.c b/src/libmain.c
index fe4f377..6b8bf8a 100644
--- a/src/libmain.c
+++ b/src/libmain.c
@@ -110,6 +110,7 @@ static gboolean print_prefix = FALSE;
#ifdef HAVE_PLUGINS
static gboolean no_plugins = FALSE;
#endif
+static gboolean open_untitled = FALSE;
static gboolean dummy = FALSE;
/* in alphabetical order of short options */
@@ -136,6 +137,9 @@ static GOptionEntry entries[] =
{ "no-session", 's', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &cl_options.load_session, N_("Don't load the previous session's files"), NULL },
#ifdef HAVE_VTE
{ "no-terminal", 't', 0, G_OPTION_ARG_NONE, &no_vte, N_("Don't load terminal support"), NULL },
+#endif
+ { "untitled", 'u', 0, G_OPTION_ARG_NONE, &open_untitled, N_("Open an \"untitled\" file with no filename"), NULL },
+#ifdef HAVE_VTE
{ "vte-lib", 0, 0, G_OPTION_ARG_FILENAME, &lib_vte, N_("Filename of libvte.so"), NULL },
#endif
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose_mode, N_("Be verbose"), NULL },
@@ -950,6 +954,9 @@ static void load_startup_files(gint argc, gchar **argv)
}
open_cl_files(argc, argv);
+
+ if (open_untitled)
+ document_new_file(NULL, NULL, NULL);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment