Add show-dupes command, fix BareExcept warnings.

This commit is contained in:
2023-05-19 09:24:53 -05:00
parent 6665f09b7b
commit 661d5959c6
4 changed files with 29 additions and 9 deletions

View File

@ -1,4 +1,4 @@
const PIT_VERSION* = "4.23.3"
const PIT_VERSION* = "4.23.4"
const USAGE* = """Usage:
pit ( new | add) <summary> [<state>] [options]
@ -14,6 +14,7 @@ const USAGE* = """Usage:
pit ( delete | rm ) <id>... [options]
pit add-binary-property <id> <propName> <propSource> [options]
pit get-binary-property <id> <propName> <propDest> [options]
pit show-dupes
pit help [options]
Options:

View File

@ -168,7 +168,7 @@ proc parseDate*(d: string): DateTime =
var errMsg = ""
for df in DATE_FORMATS:
try: return d.parse(df)
except:
except CatchableError:
errMsg &= "\n\tTried " & df & " with " & d
continue
raise newException(ValueError, "Unable to parse input as a date: " & d & errMsg)
@ -426,7 +426,7 @@ proc loadConfig*(args: Table[string, Value] = initTable[string, Value]()): PitCo
try:
cfgFile = open(pitrcFilename, fmWrite)
cfgFile.write("{\"tasksDir\": \"/path/to/tasks\"}")
except: warn "could not write default .pitrc to " & pitrcFilename
except CatchableError: warn "could not write default .pitrc to " & pitrcFilename
finally: close(cfgFile)
debug "loading config from '$#'" % [pitrcFilename]