Skip to content

Commit

Permalink
Support 'neuro -q ls' and 'neuro -q blob ls' for quiet output (#2506)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov authored Dec 28, 2021
1 parent 3dbd1fe commit bf945c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.D/2506.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support `neuro -q ls` and `neuro -q blob ls` for quiet output enforcing.
5 changes: 4 additions & 1 deletion neuro-cli/src/neuro_cli/blob_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,10 @@ async def ls(
else:
# Similar to `ls -1`, default for non-terminal on UNIX. We show full uris of
# blobs, thus column formatting does not work too well.
formatter = SimpleBlobFormatter(root.color, uri_fmtr)
if root.tty and not root.quiet:
formatter = SimpleBlobFormatter(root.color, uri_fmtr)
else:
formatter = SimpleBlobFormatter(False, uri_fmtr)

if not paths:
# List Buckets instead of blobs in bucket
Expand Down
4 changes: 2 additions & 2 deletions neuro-cli/src/neuro_cli/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ async def ls(
human_readable=human_readable, color=root.color
)
else:
if root.tty:
if root.tty and not root.quiet:
formatter = VerticalColumnsFilesFormatter(
width=root.terminal_size[0], color=root.color
)
else:
formatter = SimpleFilesFormatter(root.color)
formatter = SimpleFilesFormatter(False)

if not show_all:
files = [item for item in files if not item.name.startswith(".")]
Expand Down

0 comments on commit bf945c5

Please sign in to comment.