Fixes #649. The dump command now has implicit -y.
This commit is contained in:
parent
3eae8d7d61
commit
445ecfe946
2 changed files with 17 additions and 8 deletions
|
|
@ -62,8 +62,18 @@ proc calculateCategoryOffset(category: string): int =
|
|||
assert category.len <= longestCategory
|
||||
return longestCategory - category.len
|
||||
|
||||
proc isSuppressed(displayType: DisplayType): bool =
|
||||
# Don't print any Warning, Message or Success messages when suppression of
|
||||
# warnings is enabled. That is, unless the user asked for --verbose output.
|
||||
if globalCLI.suppressMessages and displayType >= Warning and
|
||||
globalCLI.level == HighPriority:
|
||||
return true
|
||||
|
||||
proc displayCategory(category: string, displayType: DisplayType,
|
||||
priority: Priority) =
|
||||
if isSuppressed(displayType):
|
||||
return
|
||||
|
||||
# Calculate how much the `category` must be offset to align along a center
|
||||
# line.
|
||||
let offset = calculateCategoryOffset(category)
|
||||
|
|
@ -80,6 +90,9 @@ proc displayCategory(category: string, displayType: DisplayType,
|
|||
|
||||
proc displayLine(category, line: string, displayType: DisplayType,
|
||||
priority: Priority) =
|
||||
if isSuppressed(displayType):
|
||||
return
|
||||
|
||||
displayCategory(category, displayType, priority)
|
||||
|
||||
# Display the message.
|
||||
|
|
@ -87,12 +100,6 @@ proc displayLine(category, line: string, displayType: DisplayType,
|
|||
|
||||
proc display*(category, msg: string, displayType = Message,
|
||||
priority = MediumPriority) =
|
||||
# Don't print any Warning, Message or Success messages when suppression of
|
||||
# warnings is enabled. That is, unless the user asked for --verbose output.
|
||||
if globalCLI.suppressMessages and displayType >= Warning and
|
||||
globalCLI.level == HighPriority:
|
||||
return
|
||||
|
||||
# Multiple warnings containing the same messages should not be shown.
|
||||
let warningPair = (category, msg)
|
||||
if displayType == Warning:
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@ proc initAction*(options: var Options, key: string) =
|
|||
options.action.projName = ""
|
||||
of actionDump:
|
||||
options.action.projName = ""
|
||||
options.forcePrompts = forcePromptYes
|
||||
of actionRefresh:
|
||||
options.action.optionalURL = ""
|
||||
of actionSearch:
|
||||
|
|
@ -264,8 +265,9 @@ proc parseArgument*(key: string, result: var Options) =
|
|||
result.action.search.add(key)
|
||||
of actionInit, actionDump:
|
||||
if result.action.projName != "":
|
||||
raise newException(NimbleError,
|
||||
"Can only initialize one package at a time.")
|
||||
raise newException(
|
||||
NimbleError, "Can only perform this action on one package at a time."
|
||||
)
|
||||
result.action.projName = key
|
||||
of actionCompile, actionDoc:
|
||||
result.action.file = key
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue