@@ -18,10 +18,11 @@ import (
18
18
"encoding/csv"
19
19
"encoding/json"
20
20
"fmt"
21
+ "os"
22
+
21
23
"github.com/AlecAivazis/survey/v2"
22
24
"github.com/rs/zerolog/log"
23
25
"github.com/spf13/cobra"
24
- "os"
25
26
)
26
27
27
28
// storesCmd represents the stores command
@@ -61,6 +62,11 @@ var storesListCmd = &cobra.Command{
61
62
log .Error ().Err (err ).Send ()
62
63
return err
63
64
}
65
+ if stores == nil || * stores == nil {
66
+ log .Info ().Msg ("No certificate stores found" )
67
+ outputResult ("No certificate stores found" , outputFormat )
68
+ return nil
69
+ }
64
70
output , jErr := json .Marshal (stores )
65
71
if jErr != nil {
66
72
log .Error ().Err (jErr ).Send ()
@@ -298,7 +304,13 @@ func init() {
298
304
299
305
// delete cmd
300
306
storesDeleteCmd .Flags ().StringVarP (& storeID , "id" , "i" , "" , "ID of the certificate store to delete." )
301
- storesDeleteCmd .Flags ().StringVarP (& inputFile , "file" , "f" , "" , "The path to a CSV file containing the Ids of the stores to delete." )
307
+ storesDeleteCmd .Flags ().StringVarP (
308
+ & inputFile ,
309
+ "file" ,
310
+ "f" ,
311
+ "" ,
312
+ "The path to a CSV file containing the Ids of the stores to delete." ,
313
+ )
302
314
storesDeleteCmd .Flags ().BoolVarP (& deleteAll , "all" , "a" , false , "Attempt to delete ALL stores." )
303
315
storesDeleteCmd .MarkFlagsMutuallyExclusive ("id" , "all" )
304
316
0 commit comments