From 6f9d6b70bad95d88b64469341d6d44b5e706835f Mon Sep 17 00:00:00 2001
From: josh <josh@elixxir.io>
Date: Wed, 16 Feb 2022 17:13:19 -0800
Subject: [PATCH] Add CLI option

---
 cmd/root.go | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/cmd/root.go b/cmd/root.go
index c9f094a18..57e900e14 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -316,6 +316,18 @@ var rootCmd = &cobra.Command{
 			client.DeleteAllRequests()
 		}
 
+		if viper.GetBool("delete-receive-request") {
+			client.DeleteReceiveRequest(recipientID)
+		}
+
+		if viper.GetBool("delete-sent-request") {
+			client.DeleteSentRequest(recipientID)
+		}
+
+		if viper.GetBool("delete-request") {
+			client.DeleteRequest(recipientID)
+		}
+
 		msg := message.Send{
 			Recipient:   recipientID,
 			Payload:     []byte(msgBody),
@@ -1057,6 +1069,24 @@ func init() {
 	viper.BindPFlag("delete-all-requests",
 		rootCmd.PersistentFlags().Lookup("delete-all-requests"))
 
+	rootCmd.PersistentFlags().Bool("delete-receive-request", false,
+		"Delete receive request for the specified ID given by the  "+
+			"destfile contact file.")
+	viper.BindPFlag("delete-receive-request",
+		rootCmd.PersistentFlags().Lookup("delete-receive-request"))
+
+	rootCmd.PersistentFlags().Bool("delete-sent-request", false,
+		"Delete sent request for the specified ID given by the "+
+			"destfile flag's contact file.")
+	viper.BindPFlag("delete-sent-request",
+		rootCmd.PersistentFlags().Lookup("delete-sent-request"))
+
+	rootCmd.PersistentFlags().Bool("delete-request", false,
+		"Delete the request for the specified ID given by the "+
+			"destfile flag's contact file.")
+	viper.BindPFlag("delete-request",
+		rootCmd.PersistentFlags().Lookup("delete-request"))
+
 	rootCmd.Flags().BoolP("send-auth-request", "", false,
 		"Send an auth request to the specified destination and wait"+
 			"for confirmation")
-- 
GitLab