Skip to content

Commit

Permalink
feat: continue work on showing the program's summary
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 3d184f6704f4a7284e4aaa35ba6e1386c800279b0e034cd915ac45287d180568
  • Loading branch information
thindil committed Mar 22, 2024
1 parent 7f6366d commit 755f8ce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ proc main() {.raises: [], tags: [ReadIOEffect, WriteIOEffect, RootEffect],
resultCode: int = QuitSuccess
configSections: int = 0
globalShowSummary: bool = false
let startTime = cpuTime()
let startTime: float = cpuTime()
# Check source code files with the selected rules
block checkingCode:
while configSections > -1:
# Read the configuration file and set the program
var (sources, rules, fixCommand, maxResults, showSummary) = parseConfig(
configFile = paramStr(i = 1), sections = configSections)
globalShowSummary = showSummary
if showSummary:
globalShowSummary = showSummary
# Check if the lists of source code files and rules is set
if sources.len == 0:
abortProgram(message = "No files specified to check. Please enter any files names to the configuration file.")
Expand Down Expand Up @@ -155,9 +156,9 @@ proc main() {.raises: [], tags: [ReadIOEffect, WriteIOEffect, RootEffect],
abortProgram(message = "Can't parse file '" & source &
"'. Reason: ", e = getCurrentException())
if globalShowSummary:
message(text = "SUMMARY:")
message(text = "========")
message(text = "Time taken: " & $(cpuTime() - startTime))
message(text = "SUMMARY:")
message(text = "Time taken: " & $(cpuTime() - startTime) & " sec(s)")
message(text = "Stopping nimalyzer.")
quit resultCode

Expand Down

0 comments on commit 755f8ce

Please sign in to comment.