trivial: Add a 'clear-history' command to fwupdmgr

This needs to be run as the root user to work.
This commit is contained in:
Richard Hughes 2018-01-11 10:04:50 +00:00
parent bc3a4e1f57
commit af54a0778a

View File

@ -562,6 +562,13 @@ fu_util_install_prepared (FuUtilPrivate *priv, gchar **values, GError **error)
return TRUE;
}
static gboolean
fu_util_clear_history (FuUtilPrivate *priv, gchar **values, GError **error)
{
g_autoptr(FuHistory) history = fu_history_new ();
return fu_history_remove_all (history, error);
}
static gboolean
fu_util_clear_results (FuUtilPrivate *priv, gchar **values, GError **error)
{
@ -1672,6 +1679,12 @@ main (int argc, char *argv[])
/* TRANSLATORS: command description */
_("Install prepared updates now"),
fu_util_install_prepared);
fu_util_add (priv->cmd_array,
"clear-history",
NULL,
/* TRANSLATORS: command description */
_("Erase all firmware update history"),
fu_util_clear_history);
fu_util_add (priv->cmd_array,
"install",
"FILE [ID]",