pydio / cells

Future-proof content collaboration platform
https://pydio.com
GNU Affero General Public License v3.0
1.77k stars 172 forks source link

Typo? #569

Closed casavaca closed 2 months ago

casavaca commented 2 months ago

https://github.com/pydio/cells/blob/94ed74a44f8ab1162de7f25654c476cdba4b01d7/cmd/admin-user-personal-token.go#L149

s (second), (minute), h (hour), d(day).

This is weird, do we default to minute? Is it a typo (missing m before minute)?

Looks like a typo to me since the example in the same file is like this:

/*
  Generate a token that lasts 24 hours for user admin
  $ ` + os.Args[0] + ` admin user token -u admin -e 24h

  Generate a token that lasts by default 10mn, but which expiration is refreshed to the next 10mn each time 
  the token is used.
  $ ` + os.Args[0] + ` admin user token -u admin -a 10m
*/

attempted fix:

-   pTokCmd.Flags().StringVarP(&tokExpireTime, "expire", "e", "", "Expire after duration. Format is 20u where u is a unit: s (second), (minute), h (hour), d(day).")
-   pTokCmd.Flags().StringVarP(&tokAutoRefresh, "auto", "a", "", "Auto-refresh expiration when token is used. Format is 20u where u is a unit: s (second), (minute), h (hour), d(day).")
+   pTokCmd.Flags().StringVarP(&tokExpireTime, "expire", "e", "", "Expire after duration. Format is 20u where u is a unit: s (second), m (minute), h (hour), d (day).")
+   pTokCmd.Flags().StringVarP(&tokAutoRefresh, "auto", "a", "", "Auto-refresh expiration when token is used. Format is 20u where u is a unit: s (second), m (minute), h (hour), d (day).")
cdujeu commented 2 months ago

hello @casavaca thanks for reporting. You are probably right, will recheck that! -c