ResetFlags resets the values of these flags to facilitate tests
()
| 92 | |
| 93 | // ResetFlags resets the values of these flags to facilitate tests |
| 94 | func ResetFlags() { |
| 95 | flags = &pflag.FlagSet{} |
| 96 | |
| 97 | flags.StringVarP(&chaincodeLang, "lang", "l", "golang", "Language the chaincode is written in") |
| 98 | flags.StringVarP(&chaincodePath, "path", "p", "", "Path to the chaincode") |
| 99 | flags.StringVarP(&chaincodeName, "name", "n", "", "Name of the chaincode") |
| 100 | flags.StringVarP(&chaincodeVersion, "version", "v", "", "Version of the chaincode") |
| 101 | flags.StringVarP(&packageLabel, "label", "", "", "The package label contains a human-readable description of the package") |
| 102 | flags.StringVarP(&channelID, "channelID", "C", "", "The channel on which this command should be executed") |
| 103 | flags.StringVarP(&signaturePolicy, "signature-policy", "", "", "The endorsement policy associated to this chaincode specified as a signature policy") |
| 104 | flags.StringVarP(&channelConfigPolicy, "channel-config-policy", "", "", "The endorsement policy associated to this chaincode specified as a channel config policy reference") |
| 105 | flags.StringVarP(&endorsementPlugin, "endorsement-plugin", "E", "", "The name of the endorsement plugin to be used for this chaincode") |
| 106 | flags.StringVarP(&validationPlugin, "validation-plugin", "V", "", "The name of the validation plugin to be used for this chaincode") |
| 107 | flags.StringVar(&collectionsConfigFile, "collections-config", "", "The fully qualified path to the collection JSON file including the file name") |
| 108 | flags.StringArrayVarP(&peerAddresses, "peerAddresses", "", []string{""}, "The addresses of the peers to connect to") |
| 109 | flags.StringArrayVarP(&tlsRootCertFiles, "tlsRootCertFiles", "", []string{""}, |
| 110 | "If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag") |
| 111 | flags.StringVarP(&connectionProfilePath, "connectionProfile", "", "", |
| 112 | "The fully qualified path to the connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information") |
| 113 | flags.StringVarP(&targetPeer, "targetPeer", "", "", |
| 114 | "When using a connection profile, the name of the peer to target for this action") |
| 115 | flags.BoolVar(&waitForEvent, "waitForEvent", true, |
| 116 | "Whether to wait for the event from each peer's deliver filtered service signifying that the transaction has been committed successfully") |
| 117 | flags.DurationVar(&waitForEventTimeout, "waitForEventTimeout", 30*time.Second, |
| 118 | "Time to wait for the event from each peer's deliver filtered service signifying that the 'invoke' transaction has been committed successfully") |
| 119 | flags.StringVarP(&packageID, "package-id", "", "", "The identifier of the chaincode install package") |
| 120 | flags.IntVarP(&sequence, "sequence", "", 0, "The sequence number of the chaincode definition for the channel") |
| 121 | flags.BoolVarP(&initRequired, "init-required", "", false, "Whether the chaincode requires invoking 'init'") |
| 122 | flags.StringVarP(&output, "output", "O", "", "The output format for query results. Default is human-readable plain-text. json is currently the only supported format.") |
| 123 | flags.BoolVarP(&inspectionEnabled, "inspect", "", false, "If inspect is enabled, output additional information to identify discrepancies when an organization's approval is false") |
| 124 | flags.StringVarP(&outputDirectory, "output-directory", "", "", "The output directory to use when writing a chaincode install package to disk. Default is the current working directory.") |
| 125 | } |
| 126 | |
| 127 | func attachFlags(cmd *cobra.Command, names []string) { |
| 128 | cmdFlags := cmd.Flags() |
no outgoing calls
no test coverage detected