From dbe4f9722bbd63f685b36606abbfd97cbf1dfb10 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 22 Jun 2024 16:35:47 +0700 Subject: all: implement command "export" The "export" command export all issuers to file or standard output, $ gotp export [FILE] List of known supported FORMAT is: uri. If FILE is not defined it will print to standard output. The list of exported issuers are printed in order of its label. --- README.md | 7 ++++ _AUR/PKGBUILD | 2 +- _sys/usr/share/bash-completion/completions/gotp | 13 +++++- cli.go | 43 ++++++++++++++++++++ cli_test.go | 54 +++++++++++++++++++++++++ cmd/gotp/main.go | 44 +++++++++++++++++++- gotp.go | 42 +++++++++++++++++++ provider_aegis.go | 7 ++++ testdata/cli_Export_test.txt | 3 ++ testdata/cli_with_passphrase_test.txt | 5 +++ 10 files changed, 216 insertions(+), 4 deletions(-) create mode 100644 testdata/cli_Export_test.txt diff --git a/README.md b/README.md index 13e972f..13f6e80 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,13 @@ seconds, default to 30 seconds. The ISSUER field is also optional, its define the name of provider that generate the secret. + export [FILE] + +Export all the issuers to file format that can be imported by provider. +Currently, the only supported FORMAT is "uri". +If FILE is not provided, it will print to the standard output. +The list of exported issuers are printed in order by its label. + gen