Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
57008336
Commit
57008336
authored
Feb 08, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(format): add yaml output format
parent
fccfcc8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
list.go
cmd/helm/list.go
+1
-3
messages.go
format/messages.go
+12
-0
No files found.
cmd/helm/list.go
View file @
57008336
package
main
import
(
"fmt"
"os"
"github.com/codegangsta/cli"
...
...
@@ -28,6 +27,5 @@ func list(host string) error {
if
err
!=
nil
{
return
err
}
fmt
.
Println
(
list
)
return
nil
return
format
.
YAML
(
list
)
}
format/messages.go
View file @
57008336
...
...
@@ -3,6 +3,8 @@ package format
import
(
"fmt"
"os"
"github.com/ghodss/yaml"
)
// This is all just placeholder.
...
...
@@ -35,3 +37,13 @@ func Warning(msg string, v ...interface{}) {
msg
=
"[Warning] "
+
msg
+
"
\n
"
fmt
.
Fprintf
(
os
.
Stdout
,
msg
,
v
...
)
}
func
YAML
(
v
interface
{})
error
{
y
,
err
:=
yaml
.
Marshal
(
v
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Failed to serialize to yaml: %s"
,
v
.
(
string
))
}
Msg
(
string
(
y
))
return
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment