From af54a0778a6dd15eba97ebfd74be5f080db22b3f Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 11 Jan 2018 10:04:50 +0000 Subject: [PATCH] trivial: Add a 'clear-history' command to fwupdmgr This needs to be run as the root user to work. --- src/fu-util.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/fu-util.c b/src/fu-util.c index eb3be28f2..092f84007 100644 --- a/src/fu-util.c +++ b/src/fu-util.c @@ -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]",