Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "sort"
- "github.com/docopt/docopt-go"
- )
- func usage() string {
- usage := `Usage:
- pdfq get <file> <key>
- pdfq set <file> <key> <value>`
- return usage
- }
- func main() {
- // parse the command line `comfig_example tcp 127.0.0.1 --force`
- argv := []string{"get", "7600A.pdf", "requesting_agency_address"}
- arguments, _ := docopt.Parse(usage(), argv, true, "v0.1.1", false)
- // sort the keys of the arguments map
- var keys []string
- for k := range arguments {
- keys = append(keys, k)
- }
- sort.Strings(keys)
- // print the argument keys and values
- for _, k := range keys {
- fmt.Printf("%9s %v\n", k, arguments[k])
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement