mirror of
https://codeberg.org/scip/ts.git
synced 2025-12-17 04:30:56 +01:00
Added more unittests, fixed hour format output (#4)
* little refactoring * added more tests, fixed hour format output * bump version
This commit is contained in:
@@ -31,7 +31,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
VERSIONstring = "0.0.2"
|
||||
VERSIONstring = "0.0.3"
|
||||
Usage string = `This is ts, a timestamp tool.
|
||||
|
||||
Usage: ts <time string> [<time string>]
|
||||
@@ -92,6 +92,7 @@ type Config struct {
|
||||
Args []string
|
||||
Output io.Writer
|
||||
Mode int
|
||||
TZ string // for unit tests
|
||||
}
|
||||
|
||||
func InitConfig(output io.Writer) (*Config, error) {
|
||||
@@ -135,8 +136,9 @@ func InitConfig(output io.Writer) (*Config, error) {
|
||||
if conf.Examples {
|
||||
_, err := fmt.Fprintln(output, Examples)
|
||||
if err != nil {
|
||||
Die(err)
|
||||
Die("failed write to output file handle", err)
|
||||
}
|
||||
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user