all repos — honk @ c722c29efd89cec9d30a15badda2d27d47bd2291

my fork of honk

fix args checking for chpass.
from ptd
Ted Unangst tedu@tedunangst.com
Tue, 22 Nov 2022 13:06:57 -0500
commit

c722c29efd89cec9d30a15badda2d27d47bd2291

parent

fe4e82df78ed29728fdf57afaf3ecfeb67638b8e

2 files changed, 7 insertions(+), 7 deletions(-)

jump to
M honk.gohonk.go

@@ -373,7 +373,11 @@ return

} deluser(args[1]) case "chpass": - chpass() + if len(args) < 2 { + fmt.Printf("usage: honk chpass username\n") + return + } + chpass(args[1]) case "cleanup": arg := "30" if len(args) > 1 {
M util.goutil.go

@@ -255,12 +255,8 @@ doordie(db, "delete from auth where userid = ?", userid)

doordie(db, "delete from users where userid = ?", userid) } -func chpass() { - if len(os.Args) < 3 { - fmt.Printf("need a username\n") - os.Exit(1) - } - user, err := butwhatabout(os.Args[2]) +func chpass(username string) { + user, err := butwhatabout(username) if err != nil { elog.Fatal(err) }