Skip to content

Commit bcabbe0

Browse files
committed
clean up cli command parsing, remove unnecessary code
1 parent dbc51d4 commit bcabbe0

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

cmd/lk/room.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ var (
179179
},
180180
&cli.BoolFlag{
181181
Name: "auto-subscribe",
182-
Usage: "Automatically subscribe to published tracks. Default is false.",
182+
Usage: "Automatically subscribe to published tracks.",
183183
Value: false,
184184
},
185185
},
@@ -789,10 +789,7 @@ func joinRoom(ctx context.Context, cmd *cli.Command) error {
789789
return err
790790
}
791791

792-
autoSubscribe, err := extractFlagAsBool(cmd, "auto-subscribe")
793-
if err != nil {
794-
return err
795-
}
792+
autoSubscribe := cmd.Bool("auto-subscribe")
796793

797794
participantIdentity := cmd.String("identity")
798795

cmd/lk/utils.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ func extractFlagOrArg(c *cli.Command, flag string) (string, error) {
142142
return value, nil
143143
}
144144

145-
func extractFlagAsBool(c *cli.Command, flag string) (bool, error) {
146-
if c.IsSet(flag) {
147-
return c.Bool(flag), nil
148-
}
149-
150-
return false, nil
151-
}
152-
153145
type loadParams struct {
154146
requireURL bool
155147
}

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
package livekitcli
1616

1717
const (
18-
Version = "2.4.5"
18+
Version = "2.4.6"
1919
)

0 commit comments

Comments
 (0)