change flag to string
This commit is contained in:
parent
dc079c676d
commit
efc85915c6
2 changed files with 4 additions and 7 deletions
|
|
@ -81,7 +81,7 @@ Renders the diagram to look like it was sketched by hand
|
||||||
Pixels padded around the rendered diagram
|
Pixels padded around the rendered diagram
|
||||||
.Ns .
|
.Ns .
|
||||||
.It Fl -browser Ar true
|
.It Fl -browser Ar true
|
||||||
Open the browser and go to the address that watch streams updates to
|
Browser executable that watch opens. Setting to 0 opens no browser
|
||||||
.Ns .
|
.Ns .
|
||||||
.It Fl l , -layout Ar dagre
|
.It Fl l , -layout Ar dagre
|
||||||
Set the diagram layout engine to the passed string. For a list of available options, run
|
Set the diagram layout engine to the passed string. For a list of available options, run
|
||||||
|
|
|
||||||
|
|
@ -83,10 +83,7 @@ func Run(ctx context.Context, ms *xmain.State) (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
browserFlag, err := ms.Opts.Bool("BROWSER", "browser", "", true, "open the browser and go to the address that watch streams updates to")
|
browserFlag := ms.Opts.String("BROWSER", "browser", "", "", "browser executable that watch opens. Setting to 0 opens no browser.")
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
ps, err := d2plugin.ListPlugins(ctx)
|
ps, err := d2plugin.ListPlugins(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -130,8 +127,8 @@ func Run(ctx context.Context, ms *xmain.State) (err error) {
|
||||||
if *debugFlag {
|
if *debugFlag {
|
||||||
ms.Env.Setenv("DEBUG", "1")
|
ms.Env.Setenv("DEBUG", "1")
|
||||||
}
|
}
|
||||||
if !*browserFlag {
|
if *browserFlag != "" {
|
||||||
ms.Env.Setenv("BROWSER", "0")
|
ms.Env.Setenv("BROWSER", *browserFlag)
|
||||||
}
|
}
|
||||||
|
|
||||||
var inputPath string
|
var inputPath string
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue