Skip to content

Commit

Permalink
send spinner to stderr so we don't pollute output. enable output of t…
Browse files Browse the repository at this point in the history
…ags and notes using valid json syntax.
  • Loading branch information
jonhadfield committed Jul 19, 2021
1 parent 5355130 commit 49558fd
Show file tree
Hide file tree
Showing 5 changed files with 399 additions and 18 deletions.
4 changes: 3 additions & 1 deletion cmd/sncli/note.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,9 @@ func processGetNotes(c *cli.Context, opts configOptsOutput) (msg string, err err
bOutput, err = yaml.Marshal(notesYAML)
}
if len(bOutput) > 0 {
fmt.Println(string(bOutput))
fmt.Print("{\n \"items\": ")
fmt.Print(string(bOutput))
fmt.Print("\n}")
}
}

Expand Down
5 changes: 4 additions & 1 deletion cmd/sncli/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,11 @@ func processGetTags(c *cli.Context, opts configOptsOutput) (msg string, err erro
case "yaml":
bOutput, err = yaml.Marshal(tagsYAML)
}

if len(bOutput) > 0 {
fmt.Println(string(bOutput))
fmt.Print("{\n \"tags\": ")
fmt.Print(string(bOutput))
fmt.Print("\n}")
}
}

Expand Down
32 changes: 26 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,39 @@ go 1.16
require (
github.com/asdine/storm/v3 v3.2.1
github.com/briandowns/spinner v1.12.0
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/danieljoos/wincred v1.1.1 // indirect
github.com/divan/num2words v0.0.0-20170904212200-57dba452f942
github.com/fatih/color v1.11.0
github.com/jonhadfield/gosn-v2 v0.0.0-20210522211956-75891378efe5
github.com/pelletier/go-toml v1.9.1 // indirect
github.com/fatih/color v1.12.0
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/godbus/dbus/v5 v5.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/jonhadfield/gosn-v2 v0.0.0-20210719172924-55b0cdb35616 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2 // indirect
github.com/mattn/go-isatty v0.0.13 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ryanuber/columnize v2.1.2+incompatible
github.com/spf13/viper v1.7.1
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.8.1
github.com/stretchr/objx v0.3.0 // indirect
github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.22.5
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
github.com/zalando/go-keyring v0.1.1 // indirect
go.etcd.io/bbolt v1.3.5 // indirect
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.6 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

//replace github.com/jonhadfield/gosn-v2 => ../gosn-v2
Loading

0 comments on commit 49558fd

Please sign in to comment.