Repository navigation
Two damages that change the length, truncate and append-junk, with a manifest that says where the outcome depends on the reader #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d50b5d6
431af0d
d4ce9cf
e8b28d7
7a5c9ea
156919c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -276,6 +276,18 @@ func classifyRequest(err error) (int, bool) { | |
| if errors.As(err, &impossible) { | ||
| return ExitUsage, true | ||
| } | ||
| // The same class, for the same reason: a list of damages that cuts away | ||
| // what it added, and a damage that changes the length of an archive sized | ||
| // by what it holds, are wrong whatever format or size is asked for. The fix | ||
| // is in the invocation - the order of the flags, or a size. | ||
| var eaten *damage.EatenError | ||
| if errors.As(err, &eaten) { | ||
| return ExitUsage, true | ||
| } | ||
| var unsized *damage.NeedsSizeError | ||
| if errors.As(err, &unsized) { | ||
| return ExitUsage, true | ||
| } | ||
|
Comment on lines
+283
to
+290
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| if code, ok := classifyFormat(err); ok { | ||
| return code, true | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: donislawdev/TestingFilesGenerator
Length of output: 23780
Script executed:
Repository: donislawdev/TestingFilesGenerator
Length of output: 12919
Keep the new CLI messages in one place.
Put the new damage-command messages in a dedicated English CLI strings module. The CLI does not need translations, but the user-facing text rule requires strings to be kept together for review.