Skip to content

Commit 6870622

Browse files
d-w-moorealanking
authored andcommitted
[#654] further documentation of script in usage help
1 parent ba7d25e commit 6870622

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

irods/client_init.py

100644100755
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
#!/usr/bin/env python3
2+
13
import contextlib
24
import getpass
35
import os
46
import sys
7+
import textwrap
58

69
from irods import (env_filename_from_keyword_args, derived_auth_filename)
710
import irods.client_configuration as cfg
@@ -62,13 +65,24 @@ def write_pam_credentials_to_secrets_file(password, overwrite = True, **kw):
6265
_write_encoded_auth_value(auth_file, to_encode[0], overwrite)
6366

6467
if __name__ == '__main__':
68+
extra_help = textwrap.dedent("""
69+
This Python module also functions as a script to produce a "secrets" (i.e. encoded password) file.
70+
Similar to iinit in this capacity, if the environment - and where applicable, the PAM
71+
configuration for both system and user - is already set up in every other regard, this program
72+
will generate the secrets file with appropriate permissions and in the normal location, usually:
73+
74+
~/.irods/.irodsA
75+
76+
The user will be interactively prompted to enter their cleartext password.
77+
""")
78+
6579
vector = {
6680
'pam_password': write_pam_credentials_to_secrets_file,
6781
'native': write_native_credentials_to_secrets_file
6882
}
6983

7084
if len(sys.argv) != 2:
71-
print('Usage: {} AUTH_SCHEME'.format(sys.argv[0]))
85+
print('{}\nUsage: {} AUTH_SCHEME'.format(extra_help, sys.argv[0]))
7286
print(' AUTH_SCHEME:')
7387
for x in vector:
7488
print(' {}'.format(x))

0 commit comments

Comments
 (0)