Skip to content

Commit e879356

Browse files
committed
tweak usage text & convert to f-string (SOFTWARE-4751)
i don't want to keep adding arguments to the .format(...) call
1 parent c480819 commit e879356

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

osg-comanage-project-usermap.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@
88
import urllib.request
99

1010

11+
SCRIPT = os.path.basename(__file__)
1112
ENDPOINT = "https://registry-test.cilogon.org/registry/"
1213

1314

14-
_usage = """\
15-
usage: [PASS=...] {script} [OPTIONS]
15+
_usage = f"""\
16+
usage: [PASS=...] {SCRIPT} [OPTIONS]
1617
1718
OPTIONS:
1819
-u USER[:PASS] specify USER and optionally PASS on command line
1920
-d passfd specify open fd to read PASS
2021
-f passfile specify path to file to open and read PASS
2122
-e ENDPOINT specify REST endpoint
23+
(default = {ENDPOINT})
2224
-o outfile specify output file (default: write to stdout)
2325
-h display this help text
2426
@@ -27,16 +29,13 @@
2729
2. -d passfd (read from fd)
2830
3. -f passfile (read from file)
2931
4. read from $PASS env var
30-
31-
ENDPOINT defaults to {ENDPOINT}
3232
"""
3333

3434
def usage(msg=None):
3535
if msg:
3636
print(msg + "\n", file=sys.stderr)
3737

38-
script = os.path.basename(__file__)
39-
print(_usage.format(script=script, ENDPOINT=ENDPOINT), file=sys.stderr)
38+
print(_usage, file=sys.stderr)
4039
sys.exit()
4140

4241

0 commit comments

Comments
 (0)