diff --git a/hledger-api/doc/hledger-api.1 b/hledger-api/doc/hledger-api.1 index 33bfa9bff..8b9dbd181 100644 --- a/hledger-api/doc/hledger-api.1 +++ b/hledger-api/doc/hledger-api.1 @@ -12,6 +12,10 @@ hledger\-api \- web API server for the hledger accounting tool .PD 0 .P .PD +\f[C]hledger\-api\ \-\-swagger\f[] +.PD 0 +.P +.PD \f[C]hledger\ api\ \-\-\ [OPTIONS]\f[] .SH DESCRIPTION .PP @@ -32,10 +36,12 @@ For more about the format, see hledger(1) or hledger_journal(5). .PP The server listens on port 8001, or another specified with \f[C]\-p\ PORT\f[]. -.PP Note there is no built\-in access control, so you will need to hide hledger\-api behind an authenticating proxy if you want to restrict access. +.PP +If invoked as \f[C]hledger\-api\ \-\-swagger\f[], instead of starting a +server the API docs will be printed in Swagger 2.0 format. .SH OPTIONS .PP Note: if invoking hledger\-api as a hledger subcommand, write @@ -57,6 +63,11 @@ use a different TCP port (default: 8001) .RS .RE .TP +.B \f[C]\-\-swagger\f[] +print API docs in Swagger 2.0 format, and exit +.RS +.RE +.TP .B \f[C]\-h\f[] show usage .RS diff --git a/hledger-api/doc/hledger-api.1.m4.md b/hledger-api/doc/hledger-api.1.m4.md index cb9fd94bc..9e3ea068e 100644 --- a/hledger-api/doc/hledger-api.1.m4.md +++ b/hledger-api/doc/hledger-api.1.m4.md @@ -15,6 +15,7 @@ hledger-api - web API server for the hledger accounting tool # SYNOPSIS `hledger-api [OPTIONS]`\ +`hledger-api --swagger`\ `hledger api -- [OPTIONS]` # DESCRIPTION @@ -34,11 +35,13 @@ Data is served from the usual hledger journal file: For more about the format, see hledger(1) or hledger_journal(5). The server listens on port 8001, or another specified with `-p PORT`. - Note there is no built-in access control, so you will need to hide hledger-api behind an authenticating proxy if you want to restrict access. +If invoked as `hledger-api --swagger`, instead of starting a server +the API docs will be printed in Swagger 2.0 format. + # OPTIONS Note: if invoking hledger-api as a hledger subcommand, write `--` before options as shown above. @@ -52,6 +55,9 @@ Note: if invoking hledger-api as a hledger subcommand, write `--` before options `-p --port=PORT` : use a different TCP port (default: 8001) +`--swagger` +: print API docs in Swagger 2.0 format, and exit + `-h` : show usage diff --git a/hledger-api/doc/hledger-api.1.txt b/hledger-api/doc/hledger-api.1.txt index 6655c25f5..479a817e4 100644 --- a/hledger-api/doc/hledger-api.1.txt +++ b/hledger-api/doc/hledger-api.1.txt @@ -8,6 +8,7 @@ NNAAMMEE SSYYNNOOPPSSIISS hledger-api [OPTIONS] + hledger-api --swagger hledger api -- [OPTIONS] DDEESSCCRRIIPPTTIIOONN @@ -24,12 +25,14 @@ DDEESSCCRRIIPPTTIIOONN $LEDGER_FILE, or another file specified with -f. For more about the format, see hledger(1) or hledger_journal(5). - The server listens on port 8001, or another specified with -p PORT. - - Note there is no built-in access control, so you will need to hide - hledger-api behind an authenticating proxy if you want to restrict + The server listens on port 8001, or another specified with -p PORT. + Note there is no built-in access control, so you will need to hide + hledger-api behind an authenticating proxy if you want to restrict access. + If invoked as hledger-api --swagger, instead of starting a server the + API docs will be printed in Swagger 2.0 format. + OOPPTTIIOONNSS Note: if invoking hledger-api as a hledger subcommand, write -- before options as shown above. @@ -44,6 +47,9 @@ OOPPTTIIOONNSS --pp ----ppoorrtt==PPOORRTT use a different TCP port (default: 8001) + ----sswwaaggggeerr + print API docs in Swagger 2.0 format, and exit + --hh show usage ----hheellpp show detailed help