From da7a36a866af9012c4316d7d38a5ba554062cd1d Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Thu, 18 Jan 2018 15:40:54 +0100 Subject: [PATCH] Add global flags to all queries and posts --- examples/chub/client.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/examples/chub/client.go b/examples/chub/client.go index 9f47a6e76..8d5e1c9b8 100644 --- a/examples/chub/client.go +++ b/examples/chub/client.go @@ -16,8 +16,12 @@ const ( flagTags = "tag" flagAny = "any" - flagBind = "bind" - flagCORS = "cors" + flagBind = "bind" + flagCORS = "cors" + flagTrustNode = "trust-node" + + // this is for signing + flagName = "name" ) var ( @@ -42,6 +46,13 @@ Subcommands should be defined for each particular transaction type.`, } ) +func init() { + getCmd.PersistentFlags().Bool(flagTrustNode, false, "Don't verify proofs for responses") + + postCmd.PersistentFlags().String(flagName, "", "Name of private key with which to sign") + postCmd.PersistentFlags().String(flagPassword, "", "Password to use the named private key") +} + // ClientCommands returns a sub-tree of all basic client commands // // Call AddGetCommand and AddPostCommand to add custom txs and queries