Skip to content

Commit

Permalink
add alias for get command
Browse files Browse the repository at this point in the history
  • Loading branch information
rjra2611 committed Aug 22, 2023
1 parent 971cb3c commit cc35972
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 14 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ A locally-focused workflow (local development, local execution) with the CLI may
- [`lean object-store delete`](#lean-object-store-delete)
- [`lean object-store get`](#lean-object-store-get)
- [`lean object-store list`](#lean-object-store-list)
- [`lean object-store ls`](#lean-object-store-ls)
- [`lean object-store set`](#lean-object-store-set)
- [`lean optimize`](#lean-optimize)
- [`lean project-create`](#lean-project-create)
Expand Down Expand Up @@ -1181,6 +1182,22 @@ Options:

_See code: [lean/commands/object_store/list.py](lean/commands/object_store/list.py)_

### `lean object-store ls`

Alias for 'get'

```
Usage: lean object-store ls [OPTIONS] KEY
Get a value from the organization's object store.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```

_See code: [lean/commands/object_store/ls.py](lean/commands/object_store/ls.py)_

### `lean object-store set`

Sets the data to the given key in the organization's object store.
Expand Down
12 changes: 1 addition & 11 deletions lean/commands/object_store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from click import group


from lean.commands.object_store.object_store import object_store
from lean.commands.object_store.get import get
from lean.commands.object_store.set import set
from lean.commands.object_store.list import list
from lean.commands.object_store.delete import delete

@group()
def object_store() -> None:
"""Interact with the Organization's Object Store."""
# This method is intentionally empty
# It is used as the command group for all `lean object-store <command>` commands
pass


object_store.add_command(get)
object_store.add_command(set)
object_store.add_command(list)
Expand Down
6 changes: 3 additions & 3 deletions lean/commands/object_store/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from click import command, argument

from click import argument
from lean.commands.object_store import object_store
from lean.click import LeanCommand
from lean.container import container


@command(cls=LeanCommand)
@object_store.command(cls=LeanCommand, name="get", aliases=["ls"])
@argument("key", type=str)
def get(key: str) -> str:
"""
Expand Down
23 changes: 23 additions & 0 deletions lean/commands/object_store/object_store.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean CLI v1.0. Copyright 2021 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from click import group
from lean.components.util.click_aliased_command_group import AliasedCommandGroup

@group(cls=AliasedCommandGroup, invoke_without_command=True)
def object_store() -> None:
"""Interact with the Organization's Object Store."""
# This method is intentionally empty
# It is used as the command group for all `lean object-store <command>` commands
pass

0 comments on commit cc35972

Please sign in to comment.