1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2024-11-21 19:20:05 -05:00

cmd/ofx: Add option to use carriage returns for requests

This commit is contained in:
Aaron Lindsay 2020-11-17 09:20:27 -05:00
parent 10edd94920
commit 6807c93e0e
2 changed files with 7 additions and 4 deletions

View File

@ -22,6 +22,7 @@ func (c *command) usage() {
// flags common to all server transactions
var serverURL, username, password, org, fid, appID, appVer, ofxVersion, clientUID string
var noIndentRequests bool
var carriageReturn bool
func defineServerFlags(f *flag.FlagSet) {
f.StringVar(&serverURL, "url", "", "Financial institution's OFX Server URL (see ofxhome.com if you don't know it)")
@ -34,6 +35,7 @@ func defineServerFlags(f *flag.FlagSet) {
f.StringVar(&ofxVersion, "ofxversion", "203", "OFX version to use")
f.StringVar(&clientUID, "clientuid", "", "Client UID (only required by a few FIs, like Chase)")
f.BoolVar(&noIndentRequests, "noindent", false, "Don't indent OFX requests")
f.BoolVar(&carriageReturn, "carriagereturn", false, "Use carriage return as line separator")
}
func checkServerFlags() bool {

View File

@ -14,10 +14,11 @@ func newRequest() (ofxgo.Client, *ofxgo.Request) {
}
var client = ofxgo.GetClient(serverURL,
&ofxgo.BasicClient{
AppID: appID,
AppVer: appVer,
SpecVersion: ver,
NoIndent: noIndentRequests,
AppID: appID,
AppVer: appVer,
SpecVersion: ver,
NoIndent: noIndentRequests,
CarriageReturn: carriageReturn,
})
var query ofxgo.Request