From 61c45be091c85c7bee701cdf0bb0ad9f105f62a2 Mon Sep 17 00:00:00 2001 From: PiMaDaum Date: Sun, 19 Feb 2023 00:22:19 +0100 Subject: [PATCH] Add new toClipboard command --- cmd/copyclipboard.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cmd/copyclipboard.go diff --git a/cmd/copyclipboard.go b/cmd/copyclipboard.go new file mode 100644 index 0000000..5aa0bc0 --- /dev/null +++ b/cmd/copyclipboard.go @@ -0,0 +1,26 @@ +package cmd + +import ( + "github.com/passbolt/go-passbolt-cli/resource" + "github.com/spf13/cobra" +) + +// toclipboardCmd represent the command to copy column entries to the clipboard +var toclipboardCmd = &cobra.Command{ + Use: "to-clipboard", + Short: "Copy entity column entries to clipboard", + Long: "All entries of columns defined with -c / --column are copied to the clipoard one by one.", + Aliases: []string{"clipboard", "copy-clipboard", "copy-clip"}, +} + +func init() { + rootCmd.AddCommand(toclipboardCmd) + toclipboardCmd.PersistentFlags().String("filter", "", + "Define a CEl expression as filter for any list commands. In the expression, all available columns of subcommand can be used (see -c/--column).\n"+ + "See also CEl specifications under https://github.com/google/cel-spec.\n"+ + "Examples:\n"+ + "\t--filter '(Name == \"SomeName\" || matches(Name, \"RegExpr\")) && URI.startsWith(\"https://auth.\")'\n"+ + "\t--filter 'Username == \"User\" && CreatedTimestamp > timestamp(\"2022-06-10T00:00:00.000-00:00\")'") + toclipboardCmd.PersistentFlags().IntP("delay", "d", 5, "Seconds of delay to iterating over the column entries.") + toclipboardCmd.AddCommand(resource.ResourceToClipboardCommand) +}