Skip to content

Commit 19b9626

Browse files
committed
ENH: editing the description and parameters of CLI tool
1 parent 2e7a79f commit 19b9626

File tree

1 file changed

+16
-10
lines changed
  • src/save_and_restore_api/tools

1 file changed

+16
-10
lines changed

src/save_and_restore_api/tools/cli.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,28 @@ def formatter(prog):
8787
parser = argparse.ArgumentParser(
8888
description="save-and-restore: CLI tool for operations on Save-and-Restore nodes.\n"
8989
f"save-and-restore-api version {version}\n\n"
90-
"The tool connects to the save-and-restore service. Host URL specified as the '--base-url'\n"
91-
"parameter. User name (--user-name) is used for authentication with the service.\n"
92-
"Currently supported operations:\n"
90+
"The tool connects to the save-and-restore service to perform the selected operation. \n"
91+
"The following operations are currently supported:\n"
92+
" LOGIN: check user login credentials.\n"
9393
" CONFIG GET: read an existing config node.\n"
94-
" CONFIG ADD: create a new config node. The config node is created/updated based\n"
94+
" CONFIG ADD: create a new config node. The config node is created based\n"
9595
" on the list of PVs loaded from file. The file name and format are specified\n"
9696
" using the '--file-name' ('-f') and '--file-format' parameters.\n"
9797
" CONFIG UPDATE: update an existing config node.\n"
9898
"\n"
99+
"Host URL specified as the '--base-url' parameter. User authenticates by the user name\n"
100+
"(--user-name) and the password. The user name and the password can be passed using\n"
101+
"the environment variables (see below) or entered interactively.\n"
102+
"\n"
99103
"Supported environment variables:\n"
100-
" SAVE_AND_RESTORE_API_BASE_URL: alternative way to specify the host URL.\n"
101-
" SAVE_AND_RESTORE_API_USER_NAME: alternative way to specify the user name.\n"
104+
" SAVE_AND_RESTORE_API_BASE_URL: host URL (see '--base-url' parameter);\n"
105+
" SAVE_AND_RESTORE_API_USER_NAME: user name (see '--user-name' parameter);\n"
102106
" SAVE_AND_RESTORE_API_USER_PASSWORD: user password (use with caution).\n"
103107
"CLI parameters override the respective environment variables.\n"
104108
"\n"
109+
"The program returns 0 if the operation is successful. Non-zero return codes\n"
110+
"indicate errors.\n"
111+
"\n"
105112
"Examples:\n"
106113
"\n"
107114
" Read the configuration node named 'eiger_config'. Print the full config data:\n"
@@ -185,7 +192,6 @@ def formatter(prog):
185192

186193
parser_config_get.add_argument(
187194
"--config-name",
188-
"-c",
189195
dest="config_name",
190196
type=str,
191197
default=None,
@@ -311,7 +317,7 @@ class ExitOnError(Exception):
311317
settings.show_data = args.show_data == "ON"
312318
success = True
313319
if not settings.config_name:
314-
logger.error("Required '--config-name' ('-c') parameter is not specified")
320+
logger.error("Required '--config-name' parameter is not specified")
315321
success = False
316322
if not success:
317323
parser_config_get.print_help()
@@ -325,7 +331,7 @@ class ExitOnError(Exception):
325331
settings.show_data = args.show_data == "ON"
326332
success = True
327333
if not settings.config_name:
328-
logger.error("Required '--config-name' ('-c') parameter is not specified")
334+
logger.error("Required '--config-name' parameter is not specified")
329335
success = False
330336
if not settings.file_name:
331337
logger.error("Required '--file-name' ('-f') parameter is not specified")
@@ -341,7 +347,7 @@ class ExitOnError(Exception):
341347
settings.show_data = args.show_data == "ON"
342348
success = True
343349
if not settings.config_name:
344-
logger.error("Required '--config-name' ('-c') parameter is not specified")
350+
logger.error("Required '--config-name' parameter is not specified")
345351
success = False
346352
if not settings.file_name:
347353
logger.error("Required '--file-name' ('-f') parameter is not specified")

0 commit comments

Comments
 (0)