From 12a5eeed99c51ab5f5716620c680547c4bdffa6b Mon Sep 17 00:00:00 2001
From: Antonio Torres <antorres@redhat.com>
Date: Wed, 17 Feb 2021 13:49:39 +0100
Subject: [PATCH] ipa passwd: make help for `--otp` option clearer

Update help for the `--otp` option in `ipa passwd`
to actually explain its usage.

Fixes: https://pagure.io/freeipa/issue/8244
Signed-off-by: Antonio Torres <antorres@redhat.com>
---
 ipaserver/plugins/passwd.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ipaserver/plugins/passwd.py b/ipaserver/plugins/passwd.py
index a61a945b72f..28273b49aa6 100644
--- a/ipaserver/plugins/passwd.py
+++ b/ipaserver/plugins/passwd.py
@@ -47,11 +47,17 @@
 The IPA password policy controls how often a password may be changed,
 what strength requirements exist, and the length of the password history.
 
+If the user authentication method is set to password+OTP, the user should
+pass the --otp option when resetting the password.
+
 EXAMPLES:
 
  To reset your own password:
    ipa passwd
 
+ To reset your own password when password+OTP is set as authentication method:
+   ipa passwd --otp
+
  To change another user's password:
    ipa passwd tuser1
 """)
@@ -105,7 +111,7 @@ class passwd(Command):
     takes_options =  (
         Password('otp?',
                  label=_('OTP'),
-                 doc=_('One Time Password'),
+                 doc=_('The OTP if the user has a token configured'),
                  confirm=False,
         ),
     )
