extension-tool: Show "version-name" field if set
Now that both the website and the Extension app support the custom "version-name" field, we should expose it in the CLI tool as well. As a more developer-oriented tool, keep showing the automatic version along-side the new field when both are set. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3034>
This commit is contained in:
parent
6db55eaea6
commit
ca47e7f8e3
@ -229,8 +229,9 @@ void
|
|||||||
print_extension_info (GVariantDict *info,
|
print_extension_info (GVariantDict *info,
|
||||||
DisplayFormat format)
|
DisplayFormat format)
|
||||||
{
|
{
|
||||||
const char *uuid, *name, *desc, *path, *url, *author;
|
const char *uuid, *name, *desc, *path, *url, *author, *version_name;
|
||||||
double state, version;
|
double state, version;
|
||||||
|
gboolean has_version, has_version_name;
|
||||||
|
|
||||||
g_variant_dict_lookup (info, "uuid", "&s", &uuid);
|
g_variant_dict_lookup (info, "uuid", "&s", &uuid);
|
||||||
g_print ("%s\n", uuid);
|
g_print ("%s\n", uuid);
|
||||||
@ -253,7 +254,14 @@ print_extension_info (GVariantDict *info,
|
|||||||
if (g_variant_dict_lookup (info, "original-author", "&s", &author))
|
if (g_variant_dict_lookup (info, "original-author", "&s", &author))
|
||||||
g_print (" %s: %s\n", _("Original author"), author);
|
g_print (" %s: %s\n", _("Original author"), author);
|
||||||
|
|
||||||
if (g_variant_dict_lookup (info, "version", "d", &version))
|
has_version = g_variant_dict_lookup (info, "version", "d", &version);
|
||||||
|
has_version_name = g_variant_dict_lookup (info, "version-name", "&s", &version_name);
|
||||||
|
|
||||||
|
if (has_version_name && has_version)
|
||||||
|
g_print (" %s: %s (%.0f)\n", _("Version"), version_name, version);
|
||||||
|
else if (has_version_name)
|
||||||
|
g_print (" %s: %s\n", _("Version"), version_name);
|
||||||
|
else if (has_version)
|
||||||
g_print (" %s: %.0f\n", _("Version"), version);
|
g_print (" %s: %.0f\n", _("Version"), version);
|
||||||
|
|
||||||
g_variant_dict_lookup (info, "state", "d", &state);
|
g_variant_dict_lookup (info, "state", "d", &state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user