Skip to content
This repository was archived by the owner on Apr 19, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion snakebite/commandlineparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def mv(self):
paths = self.args.dir
dst = self.args.single_arg
result = self.client.rename(paths, dst)
for line in format_results(result, json_output=self.args.json):
for line in format_results(result, json_output=self.args.json, continue_on_error=False):
print line

@command(args="[paths]", descr="remove paths", allowed_opts=["R", "S", "T"], req_args=['dir [dirs]'])
Expand Down
5 changes: 4 additions & 1 deletion snakebite/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def _create_dir_listing(nodes, human_readable, recursive, summary):
return "\n".join(ret)


def format_results(results, json_output=False):
def format_results(results, json_output=False, continue_on_error=True):
if json_output:
for result in results:
yield json.dumps(result)
Expand All @@ -142,6 +142,9 @@ def format_results(results, json_output=False):
else:
yield "ERROR: %s (reason: %s)" % (r.get('path'), r.get('error', ''))

if not continue_on_error:
break


def format_counts(results, json_output=False, human_readable=False):
if json_output:
Expand Down