Skip to content

Commit 86570c4

Browse files
committed
ENH: fix examples on CLI tool
1 parent 9f8ab6d commit 86570c4

File tree

2 files changed

+31
-15
lines changed

2 files changed

+31
-15
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,19 @@ The list of supported functions can also be extended.
6161

6262
## How to use `save-and-restore` CLI Tool
6363

64+
65+
Check login credentials. User password is requested interactively. Alternatively, the
66+
password can be passed using environment variable `SAVE_AND_RESTORE_API_USER_PASSWORD``.
67+
68+
```bash
69+
save-and-restore --base-url http://localhost:8080/save-restore --user-name=user LOGIN
70+
```
71+
6472
Read the configuration node named 'eiger_config'. Print the full configuration data
6573
(the list of PVs):
6674

6775
```bash
68-
save-and-restore --host-url http://localhost:8080/save-restore \
76+
save-and-restore --base-url http://localhost:8080/save-restore \
6977
CONFIG GET --config-name /detectors/imaging/eiger_config --show-data=ON
7078
```
7179

@@ -74,16 +82,16 @@ file ``eiger_pvs.sav``. Automatically create any missing parent folders in
7482
the path:
7583

7684
```bash
77-
save-and-restore --host-url=http://localhost:8080/save-restore --username=user\
78-
--create-folders=true CONFIG ADD --config-name=/detectors/imaging/eiger_config \
85+
save-and-restore --base-url=http://localhost:8080/save-restore --user-name=user \
86+
--create-folders=ON CONFIG ADD --config-name=/detectors/imaging/eiger_config \
7987
--file-name=eiger_pvs.sav --file-format=autosave
8088
```
8189

8290
Update an existing configuration node named 'eiger_config'. Load the list of PVs
8391
from the file ``eiger_pvs.sav``:
8492

8593
```bash
86-
save-and-restore --host-url http://localhost:8080/save-restore --username=user\
94+
save-and-restore --base-url http://localhost:8080/save-restore --user-name=user \
8795
CONFIG UPDATE --config-name /detectors/imaging/eiger_config \
8896
--file-name eiger_pvs.sav --file-format autosave
8997
```

src/save_and_restore_api/tools/cli.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,30 @@ def formatter(prog):
111111
"\n"
112112
"Examples:\n"
113113
"\n"
114-
" Read the configuration node named 'eiger_config'. Print the full config data:\n"
114+
" Check login credentials. User password is requested interactively. Alternatively,\n"
115+
" the password can be passed using environment variable `SAVE_AND_RESTORE_API_USER_PASSWORD`\n"
115116
"\n"
116-
" save-and-restore --host-url http://localhost:8080/save-restore \\\n"
117-
" CONFIG GET --config-name /detectors/imaging/eiger_config --show-data=ON\n"
117+
" save-and-restore --base-url http://localhost:8080/save-restore --user-name=user LOGIN\n"
118118
"\n"
119-
" Create a new configuration node named 'eiger_config':\n"
119+
" Read the configuration node named 'eiger_config'. Print the full configuration data\n"
120+
" (the list of PVs):\n"
120121
"\n"
121-
" save-and-restore --host-url=http://localhost:8080/save-restore --username=user\\\n"
122-
" --create-folders=true CONFIG ADD --config-name=/detectors/imaging/eiger_config \\\n"
123-
" --file-name=eiger_pvs.sav --file-format=autosave\n"
122+
" save-and-restore --base-url http://localhost:8080/save-restore \\\n"
123+
" CONFIG GET --config-name /detectors/imaging/eiger_config --show-data=ON\n"
124124
"\n"
125-
" Update an existing configuration node named 'eiger_config':\n"
125+
" Create a new configuration node named 'eiger_config'. Load the list of PVs from\n"
126+
" file ``eiger_pvs.sav``. Automatically create any missing parent folders in the path:\n"
126127
"\n"
127-
" save-and-restore --host-url http://localhost:8080/save-restore --username=user\\\n"
128-
" CONFIG UPDATE --config-name /detectors/imaging/eiger_config \\\n"
129-
" --file-name eiger_pvs.sav --file-format autosave\n",
128+
" save-and-restore --base-url=http://localhost:8080/save-restore --user-name=user \\\n"
129+
" --create-folders=ON CONFIG ADD --config-name=/detectors/imaging/eiger_config \\\n"
130+
" --file-name=eiger_pvs.sav --file-format=autosave\n"
131+
"\n"
132+
" Update an existing configuration node named 'eiger_config'. Load the list of PVs\n"
133+
" from the file ``eiger_pvs.sav``:\n"
134+
"\n"
135+
" save-and-restore --base-url http://localhost:8080/save-restore --user-name=user \\\n"
136+
" CONFIG UPDATE --config-name /detectors/imaging/eiger_config \\\n"
137+
" --file-name eiger_pvs.sav --file-format autosave\n",
130138
formatter_class=formatter,
131139
)
132140

0 commit comments

Comments
 (0)