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
2d449d3e
Commit
2d449d3e
authored
Sep 23, 2016
by
Matt Butcher
Committed by
GitHub
Sep 23, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1224 from technosophos/feat/long-list
feat(helm): make long listing default for helm list
parents
be409d31
3a483bcf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
list.go
cmd/helm/list.go
+7
-8
list_test.go
cmd/helm/list_test.go
+4
-4
No files found.
cmd/helm/list.go
View file @
2d449d3e
...
@@ -58,7 +58,7 @@ flag with the '--offset' flag allows you to page through results.
...
@@ -58,7 +58,7 @@ flag with the '--offset' flag allows you to page through results.
type
listCmd
struct
{
type
listCmd
struct
{
filter
string
filter
string
long
bool
short
bool
limit
int
limit
int
offset
string
offset
string
byDate
bool
byDate
bool
...
@@ -94,7 +94,7 @@ func newListCmd(client helm.Interface, out io.Writer) *cobra.Command {
...
@@ -94,7 +94,7 @@ func newListCmd(client helm.Interface, out io.Writer) *cobra.Command {
},
},
}
}
f
:=
cmd
.
Flags
()
f
:=
cmd
.
Flags
()
f
.
BoolVarP
(
&
list
.
long
,
"long"
,
"l"
,
false
,
"output long
listing format"
)
f
.
BoolVarP
(
&
list
.
short
,
"short"
,
"q"
,
false
,
"output short (quiet)
listing format"
)
f
.
BoolVarP
(
&
list
.
byDate
,
"date"
,
"d"
,
false
,
"sort by release date"
)
f
.
BoolVarP
(
&
list
.
byDate
,
"date"
,
"d"
,
false
,
"sort by release date"
)
f
.
BoolVarP
(
&
list
.
sortDesc
,
"reverse"
,
"r"
,
false
,
"reverse the sort order"
)
f
.
BoolVarP
(
&
list
.
sortDesc
,
"reverse"
,
"r"
,
false
,
"reverse the sort order"
)
f
.
IntVarP
(
&
list
.
limit
,
"max"
,
"m"
,
256
,
"maximum number of releases to fetch"
)
f
.
IntVarP
(
&
list
.
limit
,
"max"
,
"m"
,
256
,
"maximum number of releases to fetch"
)
...
@@ -144,14 +144,13 @@ func (l *listCmd) run() error {
...
@@ -144,14 +144,13 @@ func (l *listCmd) run() error {
rels
:=
res
.
Releases
rels
:=
res
.
Releases
if
l
.
long
{
if
l
.
short
{
fmt
.
Fprintln
(
l
.
out
,
formatList
(
rels
))
for
_
,
r
:=
range
rels
{
fmt
.
Fprintln
(
l
.
out
,
r
.
Name
)
}
return
nil
return
nil
}
}
for
_
,
r
:=
range
rels
{
fmt
.
Fprintln
(
l
.
out
,
formatList
(
rels
))
fmt
.
Fprintln
(
l
.
out
,
r
.
Name
)
}
return
nil
return
nil
}
}
...
...
cmd/helm/list_test.go
View file @
2d449d3e
...
@@ -40,8 +40,8 @@ func TestListCmd(t *testing.T) {
...
@@ -40,8 +40,8 @@ func TestListCmd(t *testing.T) {
expected
:
"thomas-guide"
,
expected
:
"thomas-guide"
,
},
},
{
{
name
:
"list
--long
"
,
name
:
"list"
,
args
:
[]
string
{
"--long"
},
args
:
[]
string
{},
resp
:
[]
*
release
.
Release
{
resp
:
[]
*
release
.
Release
{
releaseMock
(
&
releaseOptions
{
name
:
"atlas"
}),
releaseMock
(
&
releaseOptions
{
name
:
"atlas"
}),
},
},
...
@@ -49,7 +49,7 @@ func TestListCmd(t *testing.T) {
...
@@ -49,7 +49,7 @@ func TestListCmd(t *testing.T) {
},
},
{
{
name
:
"with a release, multiple flags"
,
name
:
"with a release, multiple flags"
,
args
:
[]
string
{
"--deleted"
,
"--deployed"
,
"--failed"
},
args
:
[]
string
{
"--deleted"
,
"--deployed"
,
"--failed"
,
"-q"
},
resp
:
[]
*
release
.
Release
{
resp
:
[]
*
release
.
Release
{
releaseMock
(
&
releaseOptions
{
name
:
"thomas-guide"
,
statusCode
:
release
.
Status_DELETED
}),
releaseMock
(
&
releaseOptions
{
name
:
"thomas-guide"
,
statusCode
:
release
.
Status_DELETED
}),
releaseMock
(
&
releaseOptions
{
name
:
"atlas-guide"
,
statusCode
:
release
.
Status_DEPLOYED
}),
releaseMock
(
&
releaseOptions
{
name
:
"atlas-guide"
,
statusCode
:
release
.
Status_DEPLOYED
}),
...
@@ -60,7 +60,7 @@ func TestListCmd(t *testing.T) {
...
@@ -60,7 +60,7 @@ func TestListCmd(t *testing.T) {
},
},
{
{
name
:
"with a release, multiple flags"
,
name
:
"with a release, multiple flags"
,
args
:
[]
string
{
"--all"
},
args
:
[]
string
{
"--all"
,
"-q"
},
resp
:
[]
*
release
.
Release
{
resp
:
[]
*
release
.
Release
{
releaseMock
(
&
releaseOptions
{
name
:
"thomas-guide"
,
statusCode
:
release
.
Status_DELETED
}),
releaseMock
(
&
releaseOptions
{
name
:
"thomas-guide"
,
statusCode
:
release
.
Status_DELETED
}),
releaseMock
(
&
releaseOptions
{
name
:
"atlas-guide"
,
statusCode
:
release
.
Status_DEPLOYED
}),
releaseMock
(
&
releaseOptions
{
name
:
"atlas-guide"
,
statusCode
:
release
.
Status_DEPLOYED
}),
...
...
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