raven.go: add arg length check to twt command
This commit is contained in:
parent
057771467d
commit
c274e63e82
4 changed files with 20 additions and 15 deletions
5
raven.go
5
raven.go
|
@ -28,7 +28,12 @@ func run(args []string) error {
|
||||||
} else {
|
} else {
|
||||||
switch args[1] {
|
switch args[1] {
|
||||||
case "twt":
|
case "twt":
|
||||||
|
if len(args) > 2 {
|
||||||
return Post(args[2], cfg.FeedFile, cfg.FeedAscend)
|
return Post(args[2], cfg.FeedFile, cfg.FeedAscend)
|
||||||
|
} else {
|
||||||
|
helpMe(args[0])
|
||||||
|
return errors.New("ARG is required with the twt command")
|
||||||
|
}
|
||||||
case "feed":
|
case "feed":
|
||||||
if len(args) > 2 {
|
if len(args) > 2 {
|
||||||
return GetFeed(args[2], cfg.FriendsFile, cfg.MaxPosts)
|
return GetFeed(args[2], cfg.FriendsFile, cfg.MaxPosts)
|
||||||
|
|
Loading…
Reference in a new issue