Remove tags option actually removes tags now.
This commit is contained in:
		| @@ -1 +1 @@ | |||||||
| const PTK_VERSION* = "1.0.8" | const PTK_VERSION* = "1.0.9" | ||||||
							
								
								
									
										11
									
								
								ptk.nim
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								ptk.nim
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | |||||||
| ## Simple time keeping CLI | ## Simple time keeping CLI | ||||||
|  |  | ||||||
| import algorithm, docopt, json, langutils, logging, os, nre, std/wordwrap, | import algorithm, docopt, json, langutils, logging, os, nre, std/wordwrap, | ||||||
|   sequtils, sets, strutils, tempfile, terminal, times, uuids |   sequtils, sets, strutils, sugar, tempfile, terminal, times, uuids | ||||||
|  |  | ||||||
| import timeutils except `-` | import timeutils except `-` | ||||||
|  |  | ||||||
| @@ -43,8 +43,7 @@ proc writeMarks(timeline: Timeline, indices: seq[int], includeNotes = false): vo | |||||||
|     writeLine(stdout, "No marks match the given criteria.") |     writeLine(stdout, "No marks match the given criteria.") | ||||||
|     return |     return | ||||||
|  |  | ||||||
|   var idxs = indices.sorted( |   var idxs = indices.sorted((a, b) => cmp(marks[a].time, marks[b].time)) | ||||||
|     proc(a, b: int): int = cmp(marks[a].time, marks[b].time)) |  | ||||||
|  |  | ||||||
|   let largestInterval = now - marks[idxs.first].time |   let largestInterval = now - marks[idxs.first].time | ||||||
|   let timeFormat = |   let timeFormat = | ||||||
| @@ -279,8 +278,9 @@ Options: | |||||||
|   -e --edit               Open the mark in an editor. |   -e --edit               Open the mark in an editor. | ||||||
|   -f --file <file>        Use the given timeline file. |   -f --file <file>        Use the given timeline file. | ||||||
|   -g --tags <tags>        Add the given tags (comma-separated) to the selected marks. |   -g --tags <tags>        Add the given tags (comma-separated) to the selected marks. | ||||||
|   -G --remove-tags <tagx> Remove the given tag from the selected marks. |   -G --remove-tags <tags> Remove the given tag from the selected marks. | ||||||
|   -h --help               Print this usage information. |   -h --help               Print this usage information. | ||||||
|  |  | ||||||
|   -m --matching <pattern> Restric the selection to marks matching <pattern>. |   -m --matching <pattern> Restric the selection to marks matching <pattern>. | ||||||
|   -n --notes <notes>      For add and amend, set the notes for a time mark. |   -n --notes <notes>      For add and amend, set the notes for a time mark. | ||||||
|   -t --time <time>        For add and amend, use this time instead of the current time. |   -t --time <time>        For add and amend, use this time instead of the current time. | ||||||
| @@ -491,8 +491,7 @@ Options: | |||||||
|         mark.tags = mark.tags.deduplicate |         mark.tags = mark.tags.deduplicate | ||||||
|       if args["--remove-tags"]: |       if args["--remove-tags"]: | ||||||
|         let tagsToRemove = (args["--remove-tags"] ?: "").split({',', ';'}) |         let tagsToRemove = (args["--remove-tags"] ?: "").split({',', ';'}) | ||||||
|         mark.tags = mark.tags.filter(proc (t: string): bool = |         mark.tags = mark.tags.filter((t) => not anyIt(tagsToRemove, it == t)) | ||||||
|           anyIt(tagsToRemove, it == t)) |  | ||||||
|       if args["--time"]: |       if args["--time"]: | ||||||
|         try: mark.time = parseTime($args["--time"]) |         try: mark.time = parseTime($args["--time"]) | ||||||
|         except: raise newException(ValueError, |         except: raise newException(ValueError, | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| # Package | # Package | ||||||
|  |  | ||||||
| version       = "1.0.8" | version       = "1.0.9" | ||||||
| author        = "Jonathan Bernard" | author        = "Jonathan Bernard" | ||||||
| description   = "Personal Time Keeper" | description   = "Personal Time Keeper" | ||||||
| license       = "MIT" | license       = "MIT" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user