Browse Source

Require quotes or 0x<hex> for string args

pull/1780/head
Matt Bell 8 years ago
parent
commit
115e6939d0
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      cmd/tmsp-cli/tmsp-cli.go

+ 8
- 0
cmd/tmsp-cli/tmsp-cli.go View File

@ -285,5 +285,13 @@ func stringOrHexToBytes(s string) []byte {
}
return b
}
if !strings.HasPrefix(s, "\"") || !strings.HasSuffix(s, "\"") {
fmt.Printf("Invalid string arg: \"%s\". Must be quoted or a \"0x\"-prefixed hex string\n", s)
return []byte{}
}
// TODO: return errors
return []byte(s)
}

Loading…
Cancel
Save