Refactor package CLI command (#1345)

This commit is contained in:
Ta-Ching Chen
2019-10-13 01:30:20 +08:00
committed by GitHub
parent f30e7df43d
commit e42f81a7a1
22 changed files with 1769 additions and 1172 deletions
@@ -52,6 +52,7 @@ func (opts *CreateSubCommand) do(flags cli.Input) error {
return opts.run(flags)
}
// complete creates a environment objects and populates it with default value and CLI inputs.
func (opts *CreateSubCommand) complete(flags cli.Input) error {
env, err := createEnvironmentFromCmd(flags)
if err != nil {
@@ -61,6 +62,8 @@ func (opts *CreateSubCommand) complete(flags cli.Input) error {
return nil
}
// run write the resource to a spec file or create a fission CRD with remote fission server.
// It also prints warning/error if necessary.
func (opts *CreateSubCommand) run(flags cli.Input) error {
m, err := cmd.GetMetadata(flags)
if err != nil {