goctl add stdin flag (#170)

* add stdin flag to use stdin receive api doc and use stdout output formatted result

* optimize code and output error through stderr

* fix mistake

* add dir parameter legality verify
This commit is contained in:
codingfanlt
2020-10-28 22:37:59 +08:00
committed by GitHub
parent 033525fea8
commit a13b48c33e
3 changed files with 73 additions and 35 deletions

View File

@@ -51,15 +51,16 @@ var (
Name: "dir",
Usage: "the format target dir",
},
cli.BoolFlag{
Name: "p",
Usage: "print result to console",
},
cli.BoolFlag{
Name: "iu",
Usage: "ignore update",
Required: false,
},
cli.BoolFlag{
Name: "stdin",
Usage: "use stdin to input api doc content, press \"ctrl + d\" to send EOF",
Required: false,
},
},
Action: format.GoFormatApi,
},