fix: update janitor help
@@ -9,7 +9,7 @@ import (
func NewJanitorCmd() *cobra.Command {
cmd := &cobra.Command{
- Use: "janitor <database-url>",
+ Use: "janitor [<database-url>]",
Short: "Clean the database of old tokens and login/consent requests",
Long: `This command will cleanup any expired oauth2 tokens as well as login/consent requests.
@@ -22,32 +22,32 @@ Please use this command with caution if you need to keep historic data for any r
###############
-
Janitor can be used in several ways.
1. By passing the database connection string (DSN) as an argument
Pass the database url (dsn) as an argument to janitor. E.g. janitor <database-url>
-
2. By passing the DSN as an environment variable
+
export DSN=...
janitor -e
3. By passing a configuration file containing the DSN
janitor -c /path/to/conf.yml
-
4. Extra *optional* parameters can also be added such as
-janitor <database-url> --keep-if-younger 23h --access-lifespan 1h --refresh-lifespan 40h --consent-request-lifespan 10m
+
+ janitor --keep-if-younger 23h --access-lifespan 1h --refresh-lifespan 40h --consent-request-lifespan 10m ...
5. Running only a certain cleanup
-janitor <database-url> --tokens
+
+ janitor --tokens ...
or
-janitor <database-url> --requests
+ janitor --requests ...
or both
-janitor <database-url> --tokens --requests
+ janitor --tokens --requests ...
`,
RunE: cli.NewHandler().Janitor.RunE,
Args: cli.NewHandler().Janitor.Args,
