-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prior to adding 'create/get/delete nodegroup' some refactoring has been done on the commands. We had a single file for all the commands for that verb so this has been changed to separate folders/files. Signed-off-by: Richard Case <richard.case@outlook.com>
- Loading branch information
1 parent
e229797
commit a02e6a7
Showing
16 changed files
with
432 additions
and
362 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package commands | ||
|
||
import ( | ||
"os" | ||
"strings" | ||
|
||
"github.com/kubicorn/kubicorn/pkg/logger" | ||
) | ||
|
||
// GetNameArg tests to ensure there is only 1 name argument | ||
func GetNameArg(args []string) string { | ||
if len(args) > 1 { | ||
logger.Critical("only one argument is allowed to be used as a name") | ||
os.Exit(1) | ||
} | ||
if len(args) == 1 { | ||
return (strings.TrimSpace(args[0])) | ||
} | ||
return "" | ||
} |
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.