From f04f2a8292ec1d3325b72f3f16b42e08863ac175 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 8 Jan 2020 13:07:47 -0300 Subject: [PATCH] feat: support multiple files Signed-off-by: Carlos Alexandro Becker --- main.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 1108428..6d94a09 100644 --- a/main.go +++ b/main.go @@ -101,11 +101,15 @@ func readerFromArg(s string) (*Source, error) { } func execute(cmd *cobra.Command, args []string) error { - var arg string - if len(args) > 0 { - arg = args[0] + for _, arg := range args { + if err := executeArg(cmd, arg); err != nil { + return err + } } + return nil +} +func executeArg(cmd *cobra.Command, arg string) error { // create an io.Reader from the markdown source in cli-args src, err := readerFromArg(arg) if err != nil {