From d72a81d21148c44f9e3e38451e7017b94f8b2327 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 20 Jun 2022 14:54:29 -0700 Subject: fix(tools/ipconverter): fail if number of arguments is insufficient Change-Id: Ifa382713e3f7cf2360b58d6c05a8a200258921f2 Reviewed-on: https://cl.fcuny.net/c/world/+/464 Tested-by: CI Reviewed-by: Franck Cuny --- tools/ipconverter/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/ipconverter/main.go b/tools/ipconverter/main.go index 1211970..e0893a1 100644 --- a/tools/ipconverter/main.go +++ b/tools/ipconverter/main.go @@ -11,6 +11,11 @@ import ( ) func main() { + if len(os.Args) < 2 { + fmt.Fprintf(os.Stderr, "usage: %s \n", os.Args[0]) + os.Exit(1) + } + cmd := path.Base(os.Args[1]) switch cmd { -- cgit 1.4.1