list: Add a runtime column

This is useful information, so we should allow showing it.

Closes: #2815
Approved by: alexlarsson
This commit is contained in:
Matthias Clasen
2019-04-10 13:39:35 -04:00
committed by Atomic Bot
parent 03492dfc28
commit d65ebf19f3
3 changed files with 16 additions and 1 deletions

View File

@@ -59,6 +59,7 @@ static Column all_columns[] = {
{ "version", N_("Version"), N_("Show the version"), 1, FLATPAK_ELLIPSIZE_MODE_NONE, 1, 1 },
{ "branch", N_("Branch"), N_("Show the branch"), 1, FLATPAK_ELLIPSIZE_MODE_NONE, 0, 1 },
{ "arch", N_("Arch"), N_("Show the architecture"), 1, FLATPAK_ELLIPSIZE_MODE_NONE, 0, 1 },
{ "runtime", N_("Runtime"), N_("Show the used runtime"), 1, FLATPAK_ELLIPSIZE_MODE_START, 0, 0 },
{ "origin", N_("Origin"), N_("Show the origin remote"), 1, FLATPAK_ELLIPSIZE_MODE_NONE, 1, 1 },
{ "installation", N_("Installation"), N_("Show the installation"), 1, FLATPAK_ELLIPSIZE_MODE_NONE, 1, 0 },
{ "ref", N_("Ref"), N_("Show the ref"), 1, FLATPAK_ELLIPSIZE_MODE_NONE, 1, 0 },
@@ -205,6 +206,7 @@ print_table_for_refs (gboolean print_apps,
const char *appdata_name;
const char *appdata_summary;
const char *appdata_version;
const char *runtime;
g_autofree char *latest = NULL;
g_autofree const char **subpaths = NULL;
int k;
@@ -222,9 +224,10 @@ print_table_for_refs (gboolean print_apps,
if (deploy_data == NULL)
continue;
runtime = flatpak_deploy_data_get_runtime (deploy_data);
if (app_runtime)
{
const char *runtime = flatpak_deploy_data_get_runtime (deploy_data);
if (runtime)
{
g_auto(GStrv) pref = g_strsplit (runtime, "/", 3);
@@ -295,6 +298,8 @@ print_table_for_refs (gboolean print_apps,
flatpak_table_printer_add_column (printer, appdata_version ? appdata_version : "");
else if (strcmp (columns[k].name, "installation") == 0)
flatpak_table_printer_add_column (printer, flatpak_dir_get_name_cached (dir));
else if (strcmp (columns[k].name, "runtime") == 0)
flatpak_table_printer_add_column (printer, runtime ? runtime : "");
else if (strcmp (columns[k].name, "ref") == 0)
flatpak_table_printer_add_column (printer, partial_ref);
else if (strcmp (columns[k].name, "application") == 0)

View File

@@ -221,6 +221,14 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term>runtime</term>
<listitem><para>
Show the used runtime
</para></listitem>
</varlistentry>
<varlistentry>
<term>version</term>

View File

@@ -186,6 +186,7 @@ latest
options
origin
ref
runtime
size
version
EOF
@@ -215,6 +216,7 @@ arch,latest
arch,options
arch,origin
arch,ref
arch,runtime
arch,size
arch,version
EOF