github.com/decred/politeia@v1.4.0/politeiawww/cmd/pictl/policy.go (about) 1 // Copyright (c) 2017-2019 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 "github.com/decred/politeia/politeiawww/cmd/shared" 8 9 // policyCmd gets the server policy information. 10 type policyCmd struct{} 11 12 // Execute executes the policyCmd command. 13 // 14 // This function satisfies the go-flags Commander interface. 15 func (cmd *policyCmd) Execute(args []string) error { 16 pr, err := client.Policy() 17 if err != nil { 18 return err 19 } 20 return shared.PrintJSON(pr) 21 } 22 23 // policyHelpMsg is the output of the help command when 'policy' is specified. 24 const policyHelpMsg = `policy 25 26 Fetch server policy. 27 28 Arguments: 29 None`