@@ -29,10 +29,10 @@ var (
2929 }
3030
3131 experimentDescription = Flag {
32- Name : "Description" ,
33- LongForm : "description" ,
32+ Name : "Description" ,
33+ LongForm : "description" ,
3434 ShortForm : "d" ,
35- Help : "Description of the experiment." ,
35+ Help : "Description of the experiment." ,
3636 }
3737
3838 experimentFeatureFlagID = Flag {
6060 }
6161
6262 experimentAllocations = Flag {
63- Name : "Allocations" ,
64- LongForm : "allocations" ,
65- ShortForm : "A" ,
66- Help : `Allocations as JSON array. Example: '[{"variation_id":"vid","weight":1.0,"is_control":true}]'` ,
67- IsRequired : true ,
68- }
69-
70- experimentStatusFilter = Flag {
71- Name : "Status" ,
72- LongForm : "status" ,
73- Help : "Filter by status (draft, active, paused, completed, archived)." ,
63+ Name : "Allocations" ,
64+ LongForm : "allocations" ,
65+ Help : "JSON array of allocation items ({variation_id, weight, is_control} for percentage; {variation_id, segment_id, is_control} for segment)." ,
7466 }
7567)
7668
@@ -104,8 +96,8 @@ func experimentsCmd(cli *cli) *cobra.Command {
10496
10597func listExperimentsCmd (cli * cli ) * cobra.Command {
10698 var inputs struct {
107- Status string
108- FeatureFlagID string
99+ Status string
100+ FeatureFlagID string
109101 AuthenticationFlow string
110102 }
111103
@@ -675,7 +667,8 @@ func (c *cli) buildAllocationsInteractively(cmd *cobra.Command, featureFlagID st
675667 IsControl : isControl ,
676668 }
677669
678- if strategy == "percentage" {
670+ switch strategy {
671+ case "percentage" :
679672 defaultWeight := fmt .Sprintf ("%.4f" , 1.0 / float64 (len (variations .GetVariations ())))
680673 var weightStr string
681674 q := prompt .TextInput (
@@ -696,8 +689,8 @@ func (c *cli) buildAllocationsInteractively(cmd *cobra.Command, featureFlagID st
696689 return nil , fmt .Errorf ("invalid weight %q: must be a decimal between 0.0 and 1.0" , weightStr )
697690 }
698691 alloc .Weight = & weight
699- } else if strategy == "segment" {
700- // segment_id is optional — fetch available segments and offer a picker
692+ case "segment" :
693+ // Segment_id is optional — fetch available segments and offer a picker
701694 // with a "No segment" escape hatch. If no segments exist at all, skip silently.
702695 segOpts , err := c .segmentPickerOptions (ctx )
703696 if err != nil {
0 commit comments