db2struct icon indicating copy to clipboard operation
db2struct copied to clipboard

Redirect output includes prompts and errors

Open irrelevantdotcom opened this issue 4 years ago • 2 comments

When piping output to a file db2struct -h host -u user -p -t whatever... >> ~/test.go any errors messages, and the "Password:" prompt, are also sent to the file, the latter causing an apparent freeze unless you realise and press something!

You can use -p <password> on the command line which helps but does not solve the underlying issue.

Otherwise, thanks for writing this - it has saved me a heck of a lot of typing!!! Feature request - option to specify "all tables" or a list of them.

irrelevantdotcom avatar May 07 '20 16:05 irrelevantdotcom

@irrelevantdotcom you can use the --target to write the struct output to a file.

For the all tables request, would you want all the structs in a single file or one file per struct with the name of the file the snake case version of the struct name?

Shelnutt2 avatar May 07 '20 18:05 Shelnutt2

Ah, I han't spotted that option. Ta! Both output options have their benefits .... in my case I started off appending all to one file, but ended up writing them to separate files, (which I then ran through a touch of PHP to adjust things.)

irrelevantdotcom avatar May 08 '20 13:05 irrelevantdotcom