github.com/decred/politeia@v1.4.0/politeiawww/cmd/cmswww/votedetails.go (about) 1 // Copyright (c) 2020 The Decred developers 2 // Use of this source code is governed by an ISC 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import ( 8 v1 "github.com/decred/politeia/politeiawww/api/cms/v1" 9 "github.com/decred/politeia/politeiawww/cmd/shared" 10 ) 11 12 // VoteDetailsCmd fetches the vote parameters and vote options from the 13 // politeiawww v2 VoteDetails routes. 14 type VoteDetailsCmd struct { 15 Args struct { 16 Token string `positional-arg-name:"token"` // Proposal token 17 } `positional-args:"true" required:"true"` 18 } 19 20 // Execute executes the vote details command. 21 func (cmd *VoteDetailsCmd) Execute(args []string) error { 22 vdr, err := client.VoteDetailsDCC(v1.VoteDetails{Token: cmd.Args.Token}) 23 if err != nil { 24 return err 25 } 26 27 err = shared.PrintJSON(vdr) 28 if err != nil { 29 return err 30 } 31 32 return nil 33 } 34 35 // voteDetailsHelpMsg is the output of the help command when 'votedetails' is 36 // specified. 37 const voteDetailsHelpMsg = `votedetails "token" 38 39 Fetch the vote details for a dcc. 40 41 Arguments: 42 1. token (string, required) Proposal censorship token 43 `