Skip to content

Commit

Permalink
fix(export): use same syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMarble committed Apr 16, 2022
1 parent 5862f8a commit 9213c8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/termsvg/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ import (
)

type Cmd struct {
Input string `short:"i" type:"existingfile" help:"asciicast file to export"`
Output string `optional:"" short:"o" type:"path" help:"where to save the file. Defaults to <input>.svg"`
File string `arg:"" type:"existingfile" help:"asciicast file to export"`
Output string `optional:"" short:"o" type:"path" help:"where to save the file. Defaults to <input_file>.svg"`
Mini bool `name:"minify" optional:"" short:"m" help:"minify output file. May be slower"`
}

func (cmd *Cmd) Run() error {
output := cmd.Output
if output == "" {
output = cmd.Input + ".svg"
output = cmd.File + ".svg"
}

err := export(cmd.Input, output, cmd.Mini)
err := export(cmd.File, output, cmd.Mini)
if err != nil {
return err
}
Expand Down

0 comments on commit 9213c8a

Please sign in to comment.