info/list: Move subpath list to info

We just show "partial" on the list and then
the details are in flatpak info.
This commit is contained in:
Alexander Larsson
2017-05-03 11:28:07 +02:00
parent fb6695e9a4
commit a4b16255d5
2 changed files with 13 additions and 16 deletions

View File

@@ -91,6 +91,7 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError *
g_autofree char *path = NULL;
g_autofree char *formatted = NULL;
gboolean friendly = TRUE;
g_autofree const char **subpaths = NULL;
context = g_option_context_new (_("NAME [BRANCH] - Get info about installed app and/or runtime"));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
@@ -140,6 +141,7 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError *
size = flatpak_deploy_data_get_installed_size (deploy_data);
formatted = g_format_size (size);
path = g_file_get_path (flatpak_deploy_get_dir (deploy));
subpaths = flatpak_deploy_data_get_subpaths (deploy_data);
metakey = flatpak_deploy_get_metadata (deploy);
@@ -162,6 +164,14 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError *
runtime = g_key_file_get_string (metakey, "Application", "runtime", error);
g_print ("%s%s%s %s\n", on, _("Runtime:"), off, runtime ? runtime : "-");
}
if (subpaths[0] != NULL)
{
int i;
g_print ("%s%s%s ", on, _("Installed subdirectories:"), off);
for (i = 0; subpaths[i] != NULL; i++)
g_print (i == 0 ? "%s" : ",%s", subpaths[i]);
g_print ("\n");
}
}
else
{

View File

@@ -136,9 +136,6 @@ print_table_for_refs (gboolean print_apps, GPtrArray* refs_array, const char *ar
}
flatpak_table_printer_set_column_title (printer, i++, _("Options"));
if (opt_show_details)
flatpak_table_printer_set_column_title (printer, i++, _("Subpaths"));
for (i = 0; i < refs_array->len; i++)
{
RefsData *refs_data = NULL;
@@ -240,20 +237,10 @@ print_table_for_refs (gboolean print_apps, GPtrArray* refs_array, const char *ar
flatpak_table_printer_append_with_comma (printer, "runtime");
}
if (opt_show_details)
subpaths = flatpak_deploy_data_get_subpaths (deploy_data);
if (subpaths[0] != NULL)
{
subpaths = flatpak_deploy_data_get_subpaths (deploy_data);
if (subpaths[0] == NULL)
{
flatpak_table_printer_add_column (printer, "");
}
else
{
int i;
flatpak_table_printer_add_column (printer, ""); /* subpaths */
for (i = 0; subpaths[i] != NULL; i++)
flatpak_table_printer_append_with_comma (printer, subpaths[i]);
}
flatpak_table_printer_append_with_comma (printer, "partial");
}
flatpak_table_printer_finish_row (printer);
}