Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ac793982
Commit
ac793982
authored
May 30, 2017
by
Alexander Campbell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubectl: fix inaccurate usage messages for --windows-line-endings
Part of the problem is that these are duplicated between the different commands. I'm planning to consolidate these further.
parent
63e9c67d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
apply_edit_last_applied.go
pkg/kubectl/cmd/apply_edit_last_applied.go
+3
-2
create.go
pkg/kubectl/cmd/create.go
+3
-2
edit.go
pkg/kubectl/cmd/edit.go
+4
-2
No files found.
pkg/kubectl/cmd/apply_edit_last_applied.go
View file @
ac793982
...
...
@@ -18,7 +18,7 @@ package cmd
import
(
"io"
gruntime
"runtime"
"runtime"
"github.com/spf13/cobra"
...
...
@@ -96,7 +96,8 @@ func NewCmdApplyEditLastApplied(f cmdutil.Factory, out, errOut io.Writer) *cobra
usage
:=
"to use to edit the resource"
cmdutil
.
AddFilenameOptionFlags
(
cmd
,
&
options
.
FilenameOptions
,
usage
)
cmd
.
Flags
()
.
StringVarP
(
&
options
.
Output
,
"output"
,
"o"
,
"yaml"
,
"Output format. One of: yaml|json."
)
cmd
.
Flags
()
.
BoolVar
(
&
options
.
WindowsLineEndings
,
"windows-line-endings"
,
gruntime
.
GOOS
==
"windows"
,
"Use Windows line-endings (default Unix line-endings)"
)
cmd
.
Flags
()
.
BoolVar
(
&
options
.
WindowsLineEndings
,
"windows-line-endings"
,
runtime
.
GOOS
==
"windows"
,
"Defaults to the line ending native to your platform."
)
cmdutil
.
AddRecordVarFlag
(
cmd
,
&
options
.
Record
)
return
cmd
...
...
pkg/kubectl/cmd/create.go
View file @
ac793982
...
...
@@ -19,7 +19,7 @@ package cmd
import
(
"fmt"
"io"
gruntime
"runtime"
"runtime"
"github.com/spf13/cobra"
...
...
@@ -80,7 +80,8 @@ func NewCmdCreate(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
cmdutil
.
AddValidateFlags
(
cmd
)
cmdutil
.
AddPrinterFlags
(
cmd
)
cmd
.
Flags
()
.
BoolVar
(
&
options
.
EditBeforeCreate
,
"edit"
,
false
,
"Edit the API resource before creating"
)
cmd
.
Flags
()
.
Bool
(
"windows-line-endings"
,
gruntime
.
GOOS
==
"windows"
,
"Only relevant if --edit=true. Use Windows line-endings (default Unix line-endings)"
)
cmd
.
Flags
()
.
Bool
(
"windows-line-endings"
,
runtime
.
GOOS
==
"windows"
,
"Only relevant if --edit=true. Defaults to the line ending native to your platform."
)
cmdutil
.
AddApplyAnnotationFlags
(
cmd
)
cmdutil
.
AddRecordFlag
(
cmd
)
cmdutil
.
AddDryRunFlag
(
cmd
)
...
...
pkg/kubectl/cmd/edit.go
View file @
ac793982
...
...
@@ -19,7 +19,7 @@ package cmd
import
(
"fmt"
"io"
gruntime
"runtime"
"runtime"
"github.com/spf13/cobra"
...
...
@@ -108,7 +108,9 @@ func NewCmdEdit(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
cmdutil
.
AddValidateOptionFlags
(
cmd
,
&
options
.
ValidateOptions
)
cmd
.
Flags
()
.
StringVarP
(
&
options
.
Output
,
"output"
,
"o"
,
"yaml"
,
"Output format. One of: yaml|json."
)
cmd
.
Flags
()
.
BoolVar
(
&
options
.
WindowsLineEndings
,
"windows-line-endings"
,
gruntime
.
GOOS
==
"windows"
,
"Use Windows line-endings (default Unix line-endings)"
)
cmd
.
Flags
()
.
BoolVar
(
&
options
.
WindowsLineEndings
,
"windows-line-endings"
,
runtime
.
GOOS
==
"windows"
,
"Defaults to the line ending native to your platform."
)
cmdutil
.
AddApplyAnnotationVarFlags
(
cmd
,
&
options
.
ApplyAnnotation
)
cmdutil
.
AddRecordVarFlag
(
cmd
,
&
options
.
Record
)
cmdutil
.
AddInclude3rdPartyVarFlags
(
cmd
,
&
options
.
Include3rdParty
)
...
...
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