Skip to content

Commit 1a95d47

Browse files
committed
bug fix for zero args
1 parent 89f7b4d commit 1a95d47

35 files changed

+73
-75
lines changed

cmd/reldate/reldate.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,12 @@ func main() {
253253

254254
argc := len(args)
255255

256-
var (
257-
unitString string
258-
)
259-
260256
if argc < 1 && endOfMonthFor == false {
261257
fmt.Fprintf(eout, "Missing time increment and units (e.g. +2 days) or weekday name (e.g. Monday, Mon).")
258+
os.Exit(1)
262259
} else if argc > 2 {
263260
fmt.Fprintf(eout, "Too many command line arguments.")
261+
os.Exit(1)
264262
}
265263

266264
relativeT = time.Now()
@@ -275,12 +273,12 @@ func main() {
275273
}
276274

277275
timeInc := 0
276+
unitString := ""
278277
if argc == 2 {
279278
unitString = strings.ToLower(args[1])
280279
timeInc, err = strconv.Atoi(args[0])
281280
assertOk(eout, err, "Time increment should be a positive or negative integer.\n")
282281
} else {
283-
// We may have a weekday string
284282
unitString = strings.ToLower(args[0])
285283
}
286284
t, err := reldate.RelativeTime(relativeT, timeInc, unitString)

codemeta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"license": "https://data.caltech.edu/license",
55
"codeRepository": "https://github.com/caltechlibrary/datatools",
66
"dateCreated": "2017-02-06",
7-
"dateRelease": "2023-10-02",
8-
"dateModified": "2024-03-06",
7+
"dateRelease": "2024-08-25",
8+
"dateModified": "2024-08-25",
99
"downloadUrl": "https://github.com/caltechlibrary/datatools/releases/",
1010
"issueTracker": "https://github.com/caltechlibrary/datatools/issues",
1111
"name": "datatools",
12-
"version": "1.2.9",
12+
"version": "1.2.10",
1313
"description": "A set of command line tools for working with CSV, Excel Workbooks, JSON and structured text documents.",
14-
"releaseNotes": "Added jsonobjects2csv tool",
14+
"releaseNotes": "Bug fix when no args provided",
1515
"applicationCategory": "computer programming",
1616
"developmentStatus": "active",
1717
"funder": {

codemeta2cff.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%codemeta2cff(1) user manual | version 1.2.9 1b11c42
1+
%codemeta2cff(1) user manual | version 1.2.9 89f7b4d
22
% R. S. Doiel
3-
% 2024-07-09
3+
% 2024-08-25
44

55
# NAME
66

csv2json.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csv2json(1) user manual | version 1.2.9 1b11c42
1+
%csv2json(1) user manual | version 1.2.9 89f7b4d
22
% R. S. Doiel
3-
% 2024-07-09
3+
% 2024-08-25
44

55
# NAME
66

csv2mdtable.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csv2mdtable(1) user manual | version 1.2.9 1b11c42
1+
%csv2mdtable(1) user manual | version 1.2.9 89f7b4d
22
% R. S. Doiel
3-
% 2024-07-09
3+
% 2024-08-25
44

55
# NAME
66

csv2tab.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csv2tab(1) user manual | version 1.2.9 1b11c42
1+
%csv2tab(1) user manual | version 1.2.9 89f7b4d
22
% R. S. Doiel
3-
% 2024-07-09
3+
% 2024-08-25
44

55
# NAME
66

csv2xlsx.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csv2xlsx(1) user manual | version 1.2.9 1b11c42
1+
%csv2xlsx(1) user manual | version 1.2.9 89f7b4d
22
% R. S. Doiel
3-
% 2024-07-09
3+
% 2024-08-25
44

55
# NAME
66

csvcleaner.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csvcleaner(1) user manual | version 1.2.9 1b11c42
1+
%csvcleaner(1) user manual | version 1.2.9 89f7b4d
22
% R. S. Doiel
3-
% 2024-07-09
3+
% 2024-08-25
44

55
# NAME
66

csvcols.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csvcols(1) user manual | version 1.2.9 1b11c42
1+
%csvcols(1) user manual | version 1.2.9 89f7b4d
22
% R. S. Doiel
3-
% 2024-07-09
3+
% 2024-08-25
44

55
# NAME
66

csvfind.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csvfind(1) user manual | version 1.2.9 1b11c42
1+
%csvfind(1) user manual | version 1.2.9 89f7b4d
22
% R. S. Doiel
3-
% 2024-07-09
3+
% 2024-08-25
44

55
# NAME
66

0 commit comments

Comments
 (0)