[p4] How to use "--field Description=blah" command in C# API.
perforce-user-forum at forums.perforce.com
Thu Mar 30 09:55:01 PDT 2017
Posted on behalf of forum user 'Sambwise'.
The API equivalent of --field is the Spec class. I've never used
it from the C# API (hopefully it's in there!), but assuming it works
like it does in the C++ API it's pretty simple -- you need to get the
"specdef" string from the server (get this by passing the protocol
vars "tag" and "specstring" when you ask for the spec), use
that to set up a Spec object, and then feed the Spec the form dictionary (you
get this as well when you use the "tag" protocol). Then you
can make changes to the dictionary and have the Spec object write the form back
out as plain text with Fmt().
Actually it's probably easier to just look at how --field is implemented
since that's exactly what it does. :)
-- here's how to use the Spec object
-- here's the protocol vars to set
The P4 .NET version of the Spec class looks like it's called FormSpec:
Please click here to see the post in its original format:
More information about the perforce-user