mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-02 19:39:56 -05:00
PR comments
This commit is contained in:
@@ -37,24 +37,6 @@ const (
|
||||
unsetOperationStr = "unset"
|
||||
)
|
||||
|
||||
var ConfigOptions = map[string]string{
|
||||
config.UserEmailKey: "",
|
||||
config.UserNameKey: "",
|
||||
config.UserCreds: "",
|
||||
config.DoltEditor: "",
|
||||
config.InitBranchName: "",
|
||||
config.RemotesApiHostKey: "",
|
||||
config.RemotesApiHostPortKey: "",
|
||||
config.AddCredsUrlKey: "",
|
||||
config.DoltLabInsecureKey: "",
|
||||
config.MetricsDisabled: "",
|
||||
config.MetricsHost: "",
|
||||
config.MetricsPort: "",
|
||||
config.MetricsInsecure: "",
|
||||
config.PushAutoSetupRemote: "",
|
||||
config.ProfileKey: "",
|
||||
}
|
||||
|
||||
var cfgDocs = cli.CommandDocumentationContent{
|
||||
ShortDesc: `Get and set repository or global options`,
|
||||
LongDesc: `You can query/set/replace/unset options with this command.
|
||||
@@ -227,7 +209,7 @@ func addOperation(dEnv *env.DoltEnv, setCfgTypes *set.StrSet, args []string, usa
|
||||
for i := 0; i < len(args); i += 2 {
|
||||
option := strings.ToLower(args[i])
|
||||
value := args[i+1]
|
||||
if _, ok := ConfigOptions[option]; !ok && !strings.HasPrefix(option, env.SqlServerGlobalsPrefix) {
|
||||
if _, ok := config.ConfigOptions[option]; !ok && !strings.HasPrefix(option, env.SqlServerGlobalsPrefix) {
|
||||
cli.Println("error: invalid config option, use dolt config --help to check valid configuration variables")
|
||||
return 1
|
||||
}
|
||||
|
||||
+4
-2
@@ -463,7 +463,8 @@ func runMain() int {
|
||||
}
|
||||
|
||||
globalConfig.Iter(func(name, val string) (stop bool) {
|
||||
if _, ok := commands.ConfigOptions[name]; !ok && !strings.HasPrefix(name, env.SqlServerGlobalsPrefix) {
|
||||
option := strings.ToLower(name)
|
||||
if _, ok := config.ConfigOptions[option]; !ok && !strings.HasPrefix(option, env.SqlServerGlobalsPrefix) {
|
||||
cli.Println(color.YellowString("Warning: Unknown global config option '%s'. Use `dolt config --global --unset %s` to remove.", name, name))
|
||||
}
|
||||
return false
|
||||
@@ -473,7 +474,8 @@ func runMain() int {
|
||||
localConfig, ok := dEnv.Config.GetConfig(env.LocalConfig)
|
||||
if ok {
|
||||
localConfig.Iter(func(name, val string) (stop bool) {
|
||||
if _, ok := commands.ConfigOptions[name]; !ok && !strings.HasPrefix(name, env.SqlServerGlobalsPrefix) {
|
||||
option := strings.ToLower(name)
|
||||
if _, ok := config.ConfigOptions[option]; !ok && !strings.HasPrefix(option, env.SqlServerGlobalsPrefix) {
|
||||
cli.Println(color.YellowString("Warning: Unknown local config option '%s'. Use `dolt config --local --unset %s` to remove.", name, name))
|
||||
}
|
||||
return false
|
||||
|
||||
@@ -14,6 +14,24 @@
|
||||
|
||||
package config
|
||||
|
||||
var ConfigOptions = map[string]struct{}{
|
||||
UserEmailKey: {},
|
||||
UserNameKey: {},
|
||||
UserCreds: {},
|
||||
DoltEditor: {},
|
||||
InitBranchName: {},
|
||||
RemotesApiHostKey: {},
|
||||
RemotesApiHostPortKey: {},
|
||||
AddCredsUrlKey: {},
|
||||
DoltLabInsecureKey: {},
|
||||
MetricsDisabled: {},
|
||||
MetricsHost: {},
|
||||
MetricsPort: {},
|
||||
MetricsInsecure: {},
|
||||
PushAutoSetupRemote: {},
|
||||
ProfileKey: {},
|
||||
}
|
||||
|
||||
const UserEmailKey = "user.email"
|
||||
|
||||
const UserNameKey = "user.name"
|
||||
|
||||
Reference in New Issue
Block a user