mirror of
https://github.com/charmbracelet/glow
synced 2024-12-14 14:12:27 +00:00
feat: support multiple files
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
parent
1d89273d47
commit
f04f2a8292
1 changed files with 7 additions and 3 deletions
10
main.go
10
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 {
|
||||
|
|
Loading…
Reference in a new issue