60
60
Name : "admin" ,
61
61
Usage : "User is an admin" ,
62
62
},
63
- cli.StringFlag {
64
- Name : "config, c" ,
65
- Value : "custom/conf/app.ini" ,
66
- Usage : "Custom configuration file path" ,
67
- },
68
63
cli.BoolFlag {
69
64
Name : "random-password" ,
70
65
Usage : "Generate a random password for the user" ,
96
91
Value : "" ,
97
92
Usage : "New password to set for user" ,
98
93
},
99
- cli.StringFlag {
100
- Name : "config, c" ,
101
- Value : "custom/conf/app.ini" ,
102
- Usage : "Custom configuration file path" ,
103
- },
104
94
},
105
95
}
106
96
@@ -123,26 +113,12 @@ var (
123
113
Name : "hooks" ,
124
114
Usage : "Regenerate git-hooks" ,
125
115
Action : runRegenerateHooks ,
126
- Flags : []cli.Flag {
127
- cli.StringFlag {
128
- Name : "config, c" ,
129
- Value : "custom/conf/app.ini" ,
130
- Usage : "Custom configuration file path" ,
131
- },
132
- },
133
116
}
134
117
135
118
microcmdRegenKeys = cli.Command {
136
119
Name : "keys" ,
137
120
Usage : "Regenerate authorized_keys file" ,
138
121
Action : runRegenerateKeys ,
139
- Flags : []cli.Flag {
140
- cli.StringFlag {
141
- Name : "config, c" ,
142
- Value : "custom/conf/app.ini" ,
143
- Usage : "Custom configuration file path" ,
144
- },
145
- },
146
122
}
147
123
148
124
subcmdAuth = cli.Command {
@@ -160,13 +136,6 @@ var (
160
136
Name : "list" ,
161
137
Usage : "List auth sources" ,
162
138
Action : runListAuth ,
163
- Flags : []cli.Flag {
164
- cli.StringFlag {
165
- Name : "config, c" ,
166
- Value : "custom/conf/app.ini" ,
167
- Usage : "Custom configuration file path" ,
168
- },
169
- },
170
139
}
171
140
172
141
idFlag = cli.Int64Flag {
@@ -178,22 +147,9 @@ var (
178
147
Name : "delete" ,
179
148
Usage : "Delete specific auth source" ,
180
149
Action : runDeleteAuth ,
181
- Flags : []cli.Flag {
182
- cli.StringFlag {
183
- Name : "config, c" ,
184
- Value : "custom/conf/app.ini" ,
185
- Usage : "Custom configuration file path" ,
186
- },
187
- idFlag ,
188
- },
189
150
}
190
151
191
152
oauthCLIFlags = []cli.Flag {
192
- cli.StringFlag {
193
- Name : "config, c" ,
194
- Value : "custom/conf/app.ini" ,
195
- Usage : "Custom configuration file path" ,
196
- },
197
153
cli.StringFlag {
198
154
Name : "name" ,
199
155
Value : "" ,
@@ -266,10 +222,6 @@ func runChangePassword(c *cli.Context) error {
266
222
return err
267
223
}
268
224
269
- if c .IsSet ("config" ) {
270
- setting .CustomConf = c .String ("config" )
271
- }
272
-
273
225
if err := initDB (); err != nil {
274
226
return err
275
227
}
@@ -331,10 +283,6 @@ func runCreateUser(c *cli.Context) error {
331
283
return errors .New ("must set either password or random-password flag" )
332
284
}
333
285
334
- if c .IsSet ("config" ) {
335
- setting .CustomConf = c .String ("config" )
336
- }
337
-
338
286
if err := initDB (); err != nil {
339
287
return err
340
288
}
@@ -430,21 +378,13 @@ func getReleaseCount(id int64) (int64, error) {
430
378
}
431
379
432
380
func runRegenerateHooks (c * cli.Context ) error {
433
- if c .IsSet ("config" ) {
434
- setting .CustomConf = c .String ("config" )
435
- }
436
-
437
381
if err := initDB (); err != nil {
438
382
return err
439
383
}
440
384
return models .SyncRepositoryHooks ()
441
385
}
442
386
443
387
func runRegenerateKeys (c * cli.Context ) error {
444
- if c .IsSet ("config" ) {
445
- setting .CustomConf = c .String ("config" )
446
- }
447
-
448
388
if err := initDB (); err != nil {
449
389
return err
450
390
}
@@ -473,10 +413,6 @@ func parseOAuth2Config(c *cli.Context) *models.OAuth2Config {
473
413
}
474
414
475
415
func runAddOauth (c * cli.Context ) error {
476
- if c .IsSet ("config" ) {
477
- setting .CustomConf = c .String ("config" )
478
- }
479
-
480
416
if err := initDB (); err != nil {
481
417
return err
482
418
}
@@ -490,10 +426,6 @@ func runAddOauth(c *cli.Context) error {
490
426
}
491
427
492
428
func runUpdateOauth (c * cli.Context ) error {
493
- if c .IsSet ("config" ) {
494
- setting .CustomConf = c .String ("config" )
495
- }
496
-
497
429
if ! c .IsSet ("id" ) {
498
430
return fmt .Errorf ("--id flag is missing" )
499
431
}
@@ -561,10 +493,6 @@ func runUpdateOauth(c *cli.Context) error {
561
493
}
562
494
563
495
func runListAuth (c * cli.Context ) error {
564
- if c .IsSet ("config" ) {
565
- setting .CustomConf = c .String ("config" )
566
- }
567
-
568
496
if err := initDB (); err != nil {
569
497
return err
570
498
}
@@ -587,10 +515,6 @@ func runListAuth(c *cli.Context) error {
587
515
}
588
516
589
517
func runDeleteAuth (c * cli.Context ) error {
590
- if c .IsSet ("config" ) {
591
- setting .CustomConf = c .String ("config" )
592
- }
593
-
594
518
if ! c .IsSet ("id" ) {
595
519
return fmt .Errorf ("--id flag is missing" )
596
520
}
0 commit comments