Skip to content

Commit a587c8d

Browse files
committed
Use new command-line options for NI 6L38
- The "-log" option did nothing and has been removed - "-extension" was replaced by "-format" - "-package" was replaced by "-project" - "-rules" was replaced by "-internal" and now refers to Inform's 'internal' directory which is $pkgdatadir in our case - "-extensions" is now "-external" but we don't use it, instead leaving it to its default value
1 parent bcbf89e commit a587c8d

3 files changed

Lines changed: 25 additions & 12 deletions

File tree

src/app.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,14 +1107,14 @@ void
11071107
i7_app_run_census(I7App *app, gboolean wait)
11081108
{
11091109
GFile *ni_binary = i7_app_get_binary_file(app, "ni");
1110-
GFile *builtin_extensions = get_builtin_extension_file(app, NULL, NULL);
1110+
GFile *builtin_extensions = i7_app_get_internal_dir(app);
11111111

11121112
/* Build the command line */
11131113
gchar **commandline = g_new(gchar *, 5);
11141114
commandline[0] = g_file_get_path(ni_binary);
1115-
commandline[1] = g_strdup("--rules");
1115+
commandline[1] = g_strdup("-internal");
11161116
commandline[2] = g_file_get_path(builtin_extensions);
1117-
commandline[3] = g_strdup("--census");
1117+
commandline[3] = g_strdup("-census");
11181118
commandline[4] = NULL;
11191119

11201120
g_object_unref(ni_binary);
@@ -1239,6 +1239,21 @@ i7_app_get_extension_index_page(I7App *app)
12391239
return retval;
12401240
}
12411241

1242+
/**
1243+
* i7_app_get_internal_dir:
1244+
* @app: the app
1245+
*
1246+
* Gets a reference to the application data directory, or in other words the
1247+
* directory which the NI compiler considers to be the "internal" directory.
1248+
*
1249+
* Returns: (transfer full): a new #GFile.
1250+
*/
1251+
GFile *
1252+
i7_app_get_internal_dir(I7App *app)
1253+
{
1254+
return g_object_ref(I7_APP_PRIVATE(app)->datadir);
1255+
}
1256+
12421257
/**
12431258
* i7_app_get_data_file:
12441259
* @app: the app

src/app.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ GFile *i7_app_get_extension_file(I7App *app, const gchar *author, const gchar *e
113113
GFile *i7_app_get_extension_docpage(I7App *app, const char *author, const char *extname);
114114
GFile *i7_app_get_extension_home_page(I7App *app);
115115
GFile *i7_app_get_extension_index_page(I7App *app);
116+
GFile *i7_app_get_internal_dir(I7App *app);
116117
GFile *i7_app_get_data_file(I7App *app, const gchar *filename);
117118
GFile *i7_app_get_data_file_va(I7App *app, const gchar *path1, ...) G_GNUC_NULL_TERMINATED;
118119
GFile *i7_app_check_data_file(I7App *app, const char *filename);

src/story-compile.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,25 +199,22 @@ start_ni_compiler(CompilerData *data)
199199
/* Build the command line */
200200
GPtrArray *args = g_ptr_array_new_full(7, g_free); /* usual number of args */
201201
I7App *theapp = i7_app_get();
202-
GSettings *prefs = i7_app_get_prefs(theapp);
203202
GFile *ni_compiler = i7_app_get_binary_file(theapp, "ni");
204-
GFile *extensions_dir = i7_app_get_data_file(theapp, "Extensions");
203+
GFile *internal_dir = i7_app_get_internal_dir(theapp);
205204
g_ptr_array_add(args, g_file_get_path(ni_compiler));
206-
g_ptr_array_add(args, g_strdup("-rules"));
207-
g_ptr_array_add(args, g_file_get_path(extensions_dir));
208-
g_ptr_array_add(args, g_strconcat("-extension=", i7_story_get_extension(data->story), NULL));
209-
g_ptr_array_add(args, g_strdup("-package"));
205+
g_ptr_array_add(args, g_strdup("-internal"));
206+
g_ptr_array_add(args, g_file_get_path(internal_dir));
207+
g_ptr_array_add(args, g_strconcat("-format=", i7_story_get_extension(data->story), NULL));
208+
g_ptr_array_add(args, g_strdup("-project"));
210209
g_ptr_array_add(args, g_file_get_path(data->input_file));
211210
if(!data->use_debug_flags)
212211
g_ptr_array_add(args, g_strdup("-release")); /* Omit "not for relase" material */
213-
if(g_settings_get_boolean(prefs, PREFS_SHOW_DEBUG_LOG))
214-
g_ptr_array_add(args, g_strdup("-log"));
215212
if(i7_story_get_nobble_rng(data->story))
216213
g_ptr_array_add(args, g_strdup("-rng"));
217214
g_ptr_array_add(args, NULL);
218215

219216
g_object_unref(ni_compiler);
220-
g_object_unref(extensions_dir);
217+
g_object_unref(internal_dir);
221218

222219
char **commandline = (char **)g_ptr_array_free(args, FALSE);
223220

0 commit comments

Comments
 (0)