Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Improve ux #209

Merged
merged 3 commits into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 7 additions & 3 deletions cli/cmd/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a flag?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally in cli,
the action is called command eg: esad / aws-cli / ls / git
options are called flags or parameters like "git --config" / "git checkout -b branch name ( config and b are flags/parameters)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I thought there might be some special meaning.

FlagProfile = "profile"
FlagUser = "user"
)

var cfgFile string
Expand Down
Binary file removed cli/esad
Binary file not shown.