/
get.go
33 lines (24 loc) · 912 Bytes
/
get.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// This file contains logic executed if the command "get" is typed in.
// Authors: Marten Sigwart, Philipp Frauenthaler
package cmd
import (
"github.com/spf13/cobra"
)
var getFlagChain uint8
// getCmd represents the get command
var getCmd = &cobra.Command{
Use: "get",
Short: "Get a block or transaction",
Long: `Retrieves a block or transaction from one of the chains.`,
}
func init() {
rootCmd.AddCommand(getCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// getCmd.PersistentFlags().String("foo", "", "A help for foo")
getCmd.PersistentFlags().Uint8VarP(&getFlagChain, "chain", "c", 0, "chain")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// getCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}