Skip to content

Commit eebd4fb

Browse files
committed
Short mode switches
1 parent 3505e96 commit eebd4fb

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ DMYXR3E NRT UIO
5757

5858
By default, `escli` operates in Elasticsearch mode, which expects a regular Elasticsearch service to be available.
5959

60-
To switch to App Search or Serverless mode, instead use the `escli.app` or `escli.serverless` commands respectively.
60+
To switch to App Search or Serverless mode, instead use the `escli.a` or `escli.s` commands respectively.
6161

6262
```bash
63-
$ escli.serverless search books
63+
$ escli.s search books
6464
name author release_date page_count
6565
------------------- ----------------- -------------- ------------
6666
Snow Crash Neal Stephenson 1992-06-01 470

escli/__main__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ def main(mode=None):
2929
exit(status)
3030

3131

32-
def main_app():
33-
main(mode="app")
32+
def main_app_search():
33+
main(mode="a")
3434

3535

3636
def main_serverless():
37-
main(mode="serverless")
37+
main(mode="s")
3838

3939

4040
if __name__ == '__main__':

escli/services/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ def get_settings_from_env(cls, default_user="elastic"):
101101

102102
@classmethod
103103
def create(cls, mode=None):
104-
if mode == "serverless":
104+
if mode == "s":
105105
from escli.services.serverless import ElasticsearchServerlessClient
106106
return ElasticsearchServerlessClient()
107-
elif mode == "app":
107+
elif mode == "a":
108108
from escli.services.enterprisesearch import AppSearchClient
109109
return AppSearchClient()
110110
else:

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ python_requires = >=3.6
2020
[options.entry_points]
2121
console_scripts =
2222
escli = escli.__main__:main
23-
escli.app = escli.__main__:main_app
24-
escli.serverless = escli.__main__:main_serverless
23+
escli.a = escli.__main__:main_app_search
24+
escli.s = escli.__main__:main_serverless
2525

2626
[bdist_wheel]
2727
universal = 1

0 commit comments

Comments
 (0)