git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] nicolaferraro commented on a change in pull request #24: initial code for integration context


nicolaferraro commented on a change in pull request #24: initial code for integration context
URL: https://github.com/apache/camel-k/pull/24#discussion_r216660873
 
 

 ##########
 File path: pkg/client/cmd/context_edit.go
 ##########
 @@ -0,0 +1,101 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package cmd
+
+import (
+	"errors"
+	"log"
+	"strconv"
+
+	"github.com/spf13/cobra"
+)
+
+// NewCmdContext --
+func newContextEditCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
+	impl := &contextEditCommand{
+		RootCmdOptions: rootCmdOptions,
+		discard:        false,
+		save:           false,
+		dependencies: contextResource{
+			toAdd:    make([]string, 0),
+			toRemove: make([]string, 0),
+		},
+		env: contextResource{
+			toAdd:    make([]string, 0),
+			toRemove: make([]string, 0),
+		},
+		properties: contextResource{
+			toAdd:    make([]string, 0),
+			toRemove: make([]string, 0),
+		},
+	}
+
+	cmd := cobra.Command{
+		Use:   "edit",
+		Short: "Edit an Integration Context",
+		Long:  `Edit an Integration Context.`,
+		Args:  impl.validateArgs,
+		RunE:  impl.run,
+	}
+
+	cmd.Flags().BoolVarP(&impl.discard, "discard", "x", false, "Discard current edit session")
+	cmd.Flags().BoolVarP(&impl.save, "save", "s", false, "Save edit session")
 
 Review comment:
   Doesn't seem you're opening a session (I hope you're not), it's a patch like action.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@xxxxxxxxxxxxxxxx


With regards,
Apache Git Services