-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: alias status and use commands to context cmds
- Loading branch information
1 parent
6fd2b94
commit bfdd4ac
Showing
16 changed files
with
234 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package contextcmdutil | ||
|
||
import ( | ||
"github.com/redhat-developer/app-services-cli/pkg/core/cmdutil/flagutil" | ||
"github.com/redhat-developer/app-services-cli/pkg/shared/factory" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
type FlagSet struct { | ||
cmd *cobra.Command | ||
factory *factory.Factory | ||
*flagutil.FlagSet | ||
} | ||
|
||
// NewFlagSet returns a new flag set with common context flags | ||
func NewFlagSet(cmd *cobra.Command, f *factory.Factory) *FlagSet { | ||
return &FlagSet{ | ||
cmd: cmd, | ||
factory: f, | ||
FlagSet: flagutil.NewFlagSet(cmd, f.Localizer), | ||
} | ||
} | ||
|
||
// AddContextName adds a flag for setting the name of the context | ||
func (fs *FlagSet) AddContextName(name *string) { | ||
flagName := "name" | ||
|
||
fs.StringVar( | ||
name, | ||
flagName, | ||
"", | ||
fs.factory.Localizer.MustLocalize("context.common.flag.name"), | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.