Skip to content

Commit 33d7cd8

Browse files
2.0.1 (#256)
* typos, more examples and update year in license * show an error when the config can't be parsed * bump version * update modules
1 parent 4b98d2f commit 33d7cd8

File tree

14 files changed

+155
-69
lines changed

14 files changed

+155
-69
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2022 Rasmus Lindroth
3+
Copyright (c) 2020-2023 Rasmus Lindroth
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Flags:
223223
-c --config <path> load config.toml from <path>
224224
-d --config-dir <path> load all config from <path>
225225
-u --user <name> login directly to user named <name>
226-
If you want to login to multiple accounts seperate them with a space and use quotation marks. E.g. -u "acc_one acc_two"
226+
If you want to login to multiple accounts separate them with a space and use quotation marks. E.g. -u "acc_one acc_two"
227227
If two users are named the same. Use full name like [email protected]
228228
```
229229

config.example.toml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ date-tody-format="15:04"
2727
# This displays relative dates instead for statuses that are one day or older
2828
# the output is 1y2m1d (1 year 2 months and 1 day)
2929
#
30-
# The value is an integear
30+
# The value is an integer
3131
# -1 = don't use relative dates
3232
# 0 = always use relative dates, except for dates < 1 day
3333
# 1 - ∞ = number of days to use relative dates
3434
#
3535
# Value: 28 will display a relative date for toots that are between 1-28 days
36-
# old. Otherwhise it will use the short or long format.
36+
# old. Otherwise it will use the short or long format.
3737
# default=-1
3838
date-relative=-1
3939

@@ -89,7 +89,7 @@ show-help=true
8989
# default=false
9090
stick-to-top=false
9191

92-
# Display the username of the person being boosted insted of the person that
92+
# Display the username of the person being boosted instead of the person that
9393
# boosted.
9494
# default=false
9595
show-boosted-user=false
@@ -107,7 +107,7 @@ dynamic-timeline-name=true
107107
# 1 = Show title in terminal and top bar
108108
# 2 = Only show terminal title, and no top bar in tut
109109
# 3 = No terminal title and no top bar in tut.
110-
# valid: 0, 1, 2, 4
110+
# valid: 0, 1, 2, 3
111111
# default=0
112112
terminal-title=0
113113

@@ -133,7 +133,7 @@ leader-timeout=1000
133133
# Timelines adds panes of feeds. You can customize the number of feeds, what
134134
# they should show and the key to activate them.
135135

136-
# Example:
136+
# --- START OF EXAMPLE ---
137137
# [[general.timelines]]
138138
# name="home"
139139
# type="home"
@@ -147,6 +147,7 @@ leader-timeout=1000
147147
# closed=true
148148
# on-creation-closed="new-pane"
149149
# on-focus="focus-self"
150+
# --- END OF EXAMPLE ---
150151

151152
# The name to display above the timeline
152153
# default=""
@@ -159,7 +160,7 @@ leader-timeout=1000
159160
# type=""
160161

161162
# Used for the tag type, so here you set the tag. If you have multiple you
162-
# seperate them with a space.
163+
# separate them with a space.
163164
# default=""
164165
# data=""
165166

@@ -219,7 +220,7 @@ leader-timeout=1000
219220
# list and the other content, e.g. proportions 1 3. See list-proportion above
220221
# for more information.
221222

222-
# Example:
223+
# --- START OF EXAMPLE ---
223224
# [[general.leader-actions]]
224225
# type="close-pane"
225226
# shortcut="q"
@@ -233,7 +234,7 @@ leader-timeout=1000
233234
# type="list-split"
234235
# data="column"
235236
# shortcut="c"
236-
#
237+
# --- END OF EXAMPLE ---
237238

238239
# The action you want to run.
239240
# valid: blocking, boosts, clear-notifications, close-pane, compose, edit, favorited,
@@ -378,6 +379,20 @@ poll=false
378379
posts=false
379380

380381
[open-custom]
382+
# --- START OF EXAMPLE ---
383+
# [[open-custom.programs]]
384+
# program = 'chromium'
385+
# terminal = false
386+
# hint = "[C]hrome"
387+
# keys = ["c", "C"]
388+
#
389+
# [[open-custom.programs]]
390+
# program = 'imv'
391+
# terminal = false
392+
# hint = "[I]mv"
393+
# keys = ["i", "I"]"
394+
# --- END OF EXAMPLE ---
395+
381396
# [[open-custom.programs]]
382397
# The program to open the file with.
383398
# default=""
@@ -532,19 +547,19 @@ controls-text=""
532547
# default=""
533548
controls-highlight=""
534549

535-
# The background color in dropdowns and autocompletions
550+
# The background color in drop-downs and autocompletions
536551
# default=""
537552
autocomplete-background=""
538553

539-
# The text color in dropdowns at autocompletions
554+
# The text color in drop-downs at autocompletions
540555
# default=""
541556
autocomplete-text=""
542557

543-
# The background color for selected value in dropdowns and autocompletions
558+
# The background color for selected value in drop-downs and autocompletions
544559
# default=""
545560
autocomplete-selected-background=""
546561

547-
# The text color for selected value in dropdowns and autocompletions
562+
# The text color for selected value in drop-downs and autocompletions
548563
# default=""
549564
autocomplete-selected-text=""
550565

@@ -571,7 +586,7 @@ timeline-name-text=""
571586
#
572587
# The hint option lets you set which part of the hint that will be highlighted
573588
# in tut. E.g. [F]avorite results in a highlighted F and the rest of the text is
574-
# displayed normaly.
589+
# displayed normally.
575590
# Some of the options can be in two states, like favorites, so there you can set
576591
# the hint-alt option to something like Un[F]avorite.
577592
#
@@ -582,7 +597,7 @@ timeline-name-text=""
582597
# "Yan[K]" = YanK with a highlighted K
583598
#
584599
# The keys option lets you define what key that should be pressed. This is
585-
# limited to on character only and they are case sensetive.
600+
# limited to on character only and they are case sensitive.
586601
# Example:
587602
# keys=["j","J"]
588603
#

config/config.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,9 +1381,15 @@ func parseConfig(filepath string, cnfPath string, cnfDir string) (Config, error)
13811381
return conf, err
13821382
}
13831383
var cnf ConfigTOML
1384-
toml.NewDecoder(f).Decode(&cnf)
1384+
d := toml.NewDecoder(f)
1385+
err = d.Decode(&cnf)
1386+
13851387
if err != nil {
1386-
log.Fatalln(err)
1388+
fmt.Print("Error while parsing your config:\n")
1389+
fmt.Println(err)
1390+
fmt.Println("\nThis message can be a bit unclear. If you don't understand the error you can open up an issue and I'll try to help you. Please post your config.toml in the issue.")
1391+
fmt.Println("https://github.com/RasmusLindroth/tut/issues")
1392+
os.Exit(1)
13871393
}
13881394
f.Close()
13891395
conf.General = parseGeneral(cnf.General)

config/default_config.go

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ date-tody-format="15:04"
2929
# This displays relative dates instead for statuses that are one day or older
3030
# the output is 1y2m1d (1 year 2 months and 1 day)
3131
#
32-
# The value is an integear
32+
# The value is an integer
3333
# -1 = don't use relative dates
3434
# 0 = always use relative dates, except for dates < 1 day
3535
# 1 - ∞ = number of days to use relative dates
3636
#
3737
# Value: 28 will display a relative date for toots that are between 1-28 days
38-
# old. Otherwhise it will use the short or long format.
38+
# old. Otherwise it will use the short or long format.
3939
# default=-1
4040
date-relative=-1
4141
@@ -91,7 +91,7 @@ show-help=true
9191
# default=false
9292
stick-to-top=false
9393
94-
# Display the username of the person being boosted insted of the person that
94+
# Display the username of the person being boosted instead of the person that
9595
# boosted.
9696
# default=false
9797
show-boosted-user=false
@@ -109,7 +109,7 @@ dynamic-timeline-name=true
109109
# 1 = Show title in terminal and top bar
110110
# 2 = Only show terminal title, and no top bar in tut
111111
# 3 = No terminal title and no top bar in tut.
112-
# valid: 0, 1, 2, 4
112+
# valid: 0, 1, 2, 3
113113
# default=0
114114
terminal-title=0
115115
@@ -135,7 +135,7 @@ leader-timeout=1000
135135
# Timelines adds panes of feeds. You can customize the number of feeds, what
136136
# they should show and the key to activate them.
137137
138-
# Example:
138+
# --- START OF EXAMPLE ---
139139
# [[general.timelines]]
140140
# name="home"
141141
# type="home"
@@ -149,6 +149,7 @@ leader-timeout=1000
149149
# closed=true
150150
# on-creation-closed="new-pane"
151151
# on-focus="focus-self"
152+
# --- END OF EXAMPLE ---
152153
153154
# The name to display above the timeline
154155
# default=""
@@ -161,7 +162,7 @@ leader-timeout=1000
161162
# type=""
162163
163164
# Used for the tag type, so here you set the tag. If you have multiple you
164-
# seperate them with a space.
165+
# separate them with a space.
165166
# default=""
166167
# data=""
167168
@@ -221,7 +222,7 @@ leader-timeout=1000
221222
# list and the other content, e.g. proportions 1 3. See list-proportion above
222223
# for more information.
223224
224-
# Example:
225+
# --- START OF EXAMPLE ---
225226
# [[general.leader-actions]]
226227
# type="close-pane"
227228
# shortcut="q"
@@ -235,7 +236,7 @@ leader-timeout=1000
235236
# type="list-split"
236237
# data="column"
237238
# shortcut="c"
238-
#
239+
# --- END OF EXAMPLE ---
239240
240241
# The action you want to run.
241242
# valid: blocking, boosts, clear-notifications, close-pane, compose, edit, favorited,
@@ -380,6 +381,20 @@ poll=false
380381
posts=false
381382
382383
[open-custom]
384+
# --- START OF EXAMPLE ---
385+
# [[open-custom.programs]]
386+
# program = 'chromium'
387+
# terminal = false
388+
# hint = "[C]hrome"
389+
# keys = ["c", "C"]
390+
#
391+
# [[open-custom.programs]]
392+
# program = 'imv'
393+
# terminal = false
394+
# hint = "[I]mv"
395+
# keys = ["i", "I"]"
396+
# --- END OF EXAMPLE ---
397+
383398
# [[open-custom.programs]]
384399
# The program to open the file with.
385400
# default=""
@@ -534,19 +549,19 @@ controls-text=""
534549
# default=""
535550
controls-highlight=""
536551
537-
# The background color in dropdowns and autocompletions
552+
# The background color in drop-downs and autocompletions
538553
# default=""
539554
autocomplete-background=""
540555
541-
# The text color in dropdowns at autocompletions
556+
# The text color in drop-downs at autocompletions
542557
# default=""
543558
autocomplete-text=""
544559
545-
# The background color for selected value in dropdowns and autocompletions
560+
# The background color for selected value in drop-downs and autocompletions
546561
# default=""
547562
autocomplete-selected-background=""
548563
549-
# The text color for selected value in dropdowns and autocompletions
564+
# The text color for selected value in drop-downs and autocompletions
550565
# default=""
551566
autocomplete-selected-text=""
552567
@@ -573,7 +588,7 @@ timeline-name-text=""
573588
#
574589
# The hint option lets you set which part of the hint that will be highlighted
575590
# in tut. E.g. [F]avorite results in a highlighted F and the rest of the text is
576-
# displayed normaly.
591+
# displayed normally.
577592
# Some of the options can be in two states, like favorites, so there you can set
578593
# the hint-alt option to something like Un[F]avorite.
579594
#
@@ -584,7 +599,7 @@ timeline-name-text=""
584599
# "Yan[K]" = YanK with a highlighted K
585600
#
586601
# The keys option lets you define what key that should be pressed. This is
587-
# limited to on character only and they are case sensetive.
602+
# limited to on character only and they are case sensitive.
588603
# Example:
589604
# keys=["j","J"]
590605
#

docs/man/tut.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
. ftr VB CB
1515
. ftr VBI CBI
1616
.\}
17-
.TH "tut" "1" "2023-01-23" "tut 2.0.0" ""
17+
.TH "tut" "1" "2023-01-24" "tut 2.0.0" ""
1818
.hy
1919
.SH NAME
2020
.PP
@@ -46,7 +46,7 @@ Load all config from \f[I]<path>\f[R]
4646
.TP
4747
\f[B]-u\f[R], \f[B]--user\f[R] <name>
4848
Login directly to user named \f[I]<name>\f[R].
49-
If you want to login to multiple accounts seperate them with a space and
49+
If you want to login to multiple accounts separate them with a space and
5050
use quotation marks.
5151
E.g.
5252
-u \[lq]acc_one acc_two\[rq].

docs/man/tut.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% tut(1) tut 2.0.0
22
% Rasmus Lindroth
3-
% 2023-01-23
3+
% 2023-01-24
44

55
# NAME
66
tut - a Mastodon TUI
@@ -31,7 +31,7 @@ To see keys and commands you can use inside of tut check tut(7).
3131

3232
**-u**, **\--user** \<name\>
3333
: Login directly to user named *\<name\>*.
34-
: If you want to login to multiple accounts seperate them with a space and use quotation marks. E.g. -u "acc_one acc_two".
34+
: If you want to login to multiple accounts separate them with a space and use quotation marks. E.g. -u "acc_one acc_two".
3535
: If two users are named the same, use full name like *[email protected]*
3636

3737
# COMMANDS

0 commit comments

Comments
 (0)