Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Config options should be with dash not underscore #46

Closed
wants to merge 1 commit into from
Closed
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 pkg/cc/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func trimPluginName(cfg *Config) *Config {
for plugin, options := range cfg.Plugins {
newCfg.Plugins[plugin] = make(map[string]interface{})
for option, value := range options {
trimmedOptionName := strings.TrimPrefix(option, plugin+"_")
trimmedOptionName := strings.TrimPrefix(option, plugin+"-")
newCfg.Plugins[plugin][trimmedOptionName] = value
}
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ func checkForUpdates(provider provider.Provider, c *cc.CC) (bool, string, error)
return false, "", err
}

currentVers := strings.Split(resp.Build.Version, ".")
currentVersion := strings.TrimPrefix(resp.Build.Version, "v")
currentVers := strings.Split(currentVersion, ".")

latestVers := strings.Split(latest, ".")

for index, ver := range currentVers {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

type DeleteCmd struct {
From string `short:"f" help:"The idp provider name you want to delete from"`
UserIds []string `arg:"" name:"user_id" help:"Users to remove." type:"string"`
UserIds []string `arg:"" name:"user-id" help:"Users to remove." type:"string"`
NoUpdateCheck bool `short:"n" help:"Don't check for plugins updates"`
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewPlugin(provider provider.Provider, c *cc.CC) (*Plugin, error) {
c.Log.Info().Msgf("loaded plugin %s - version: %s, commit: %s", plugin.Name, providerInfo.Build.Version, providerInfo.Build.Commit)

for _, config := range providerInfo.Configs {
configName := fmt.Sprintf("%s_%s", plugin.Name, config.Name)
configName := fmt.Sprintf("%s-%s", plugin.Name, config.Name)
flagsMap[configName] = plugin.Name

plugin.Plugins = append(plugin.Plugins, getFlagStruct(configName, config.Description, plugin.Name, config.Type))
Expand Down