diff --git a/cli/cmd/create.go b/cli/cmd/create.go index 12a68bd4..5649f3ac 100644 --- a/cli/cmd/create.go +++ b/cli/cmd/create.go @@ -20,8 +20,8 @@ import ( const ( commandCreate = "create" - interactive = "interactive" generate = "generate-skeleton" + interactive = "interactive" ) //createCmd creates detectors based on file configuration, if interactive mode is on, diff --git a/cli/cmd/profile.go b/cli/cmd/profile.go index ef3eac08..2cb1480a 100644 --- a/cli/cmd/profile.go +++ b/cli/cmd/profile.go @@ -27,13 +27,13 @@ import ( ) const ( - profileBaseCmdName = "profile" + alignLeft = 0 createNewProfileCmdName = "create" deleteNewProfileCmdName = "delete" - listProfileCmdName = "list" esadProfile = "ESAD_PROFILE" + listProfileCmdName = "list" padding = 3 - alignLeft = 0 + profileBaseCmdName = "profile" ) //profilesCmd is main command for profile operations like list, create and delete @@ -92,6 +92,10 @@ func displayProfiles() { fmt.Println("failed to load config due to ", err) return } + if len(config.Profiles) < 1 { + fmt.Println("No profiles yet (use 'esad profile create' to create profile)") + return + } w := tabwriter.NewWriter(os.Stdout, 0, 0, padding, ' ', alignLeft) fmt.Fprintln(w, "Name\t\tUserName\t\tEndpoint-url\t") diff --git a/cli/cmd/root.go b/cli/cmd/root.go index a85653c0..43cc7a1f 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -29,15 +29,15 @@ import ( ) const ( - defaultFileType = "yaml" - defaultConfigFileName = "config" cliName = "esad" + defaultConfigFileName = "config" + defaultFileType = "yaml" esadConfigFile = "ESAD_CONFIG_FILE" FlagConfig = "config" - FlagUser = "user" - FlagPassword = "password" FlagEndpoint = "endpoint" + FlagPassword = "password" FlagProfile = "profile" + FlagUser = "user" ) var cfgFile string diff --git a/cli/esad b/cli/esad deleted file mode 100755 index 51a94b31..00000000 Binary files a/cli/esad and /dev/null differ