mirror of
https://github.com/onyx-and-iris/gobs-cli.git
synced 2025-05-20 16:10:26 +01:00
add missing record status command
add replaybuffer toggle to readme
This commit is contained in:
parent
c04324d173
commit
dd0bbfc0da
@ -50,3 +50,6 @@ issues:
|
|||||||
exclude:
|
exclude:
|
||||||
# gosec: Duplicated errcheck checks
|
# gosec: Duplicated errcheck checks
|
||||||
- G104
|
- G104
|
||||||
|
exclude-files:
|
||||||
|
# Exclude vendor directory
|
||||||
|
- main_test.go
|
||||||
|
@ -373,6 +373,12 @@ gobs-cli replaybuffer start
|
|||||||
gobs-cli replaybuffer stop
|
gobs-cli replaybuffer stop
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- toggle: Toggle replay buffer.
|
||||||
|
|
||||||
|
```console
|
||||||
|
gobs-cli replaybuffer toggle
|
||||||
|
```
|
||||||
|
|
||||||
- status: Get replay buffer status.
|
- status: Get replay buffer status.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
24
record.go
24
record.go
@ -9,6 +9,7 @@ type RecordCmd struct {
|
|||||||
Start RecordStartCmd `cmd:"" help:"Start recording." aliases:"s"`
|
Start RecordStartCmd `cmd:"" help:"Start recording." aliases:"s"`
|
||||||
Stop RecordStopCmd `cmd:"" help:"Stop recording." aliases:"st"`
|
Stop RecordStopCmd `cmd:"" help:"Stop recording." aliases:"st"`
|
||||||
Toggle RecordToggleCmd `cmd:"" help:"Toggle recording." aliases:"tg"`
|
Toggle RecordToggleCmd `cmd:"" help:"Toggle recording." aliases:"tg"`
|
||||||
|
Status RecordStatusCmd `cmd:"" help:"Show recording status." aliases:"ss"`
|
||||||
Pause RecordPauseCmd `cmd:"" help:"Pause recording." aliases:"p"`
|
Pause RecordPauseCmd `cmd:"" help:"Pause recording." aliases:"p"`
|
||||||
Resume RecordResumeCmd `cmd:"" help:"Resume recording." aliases:"r"`
|
Resume RecordResumeCmd `cmd:"" help:"Resume recording." aliases:"r"`
|
||||||
}
|
}
|
||||||
@ -57,6 +58,29 @@ func (cmd *RecordToggleCmd) Run(ctx *context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RecordStatusCmd shows the recording status.
|
||||||
|
type RecordStatusCmd struct{} // size = 0x0
|
||||||
|
|
||||||
|
// Run executes the command to show recording status.
|
||||||
|
func (cmd *RecordStatusCmd) Run(ctx *context) error {
|
||||||
|
status, err := ctx.Client.Record.GetRecordStatus()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if status.OutputActive {
|
||||||
|
if status.OutputPaused {
|
||||||
|
fmt.Fprintln(ctx.Out, "Recording is paused.")
|
||||||
|
} else {
|
||||||
|
fmt.Fprintln(ctx.Out, "Recording is in progress.")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fmt.Fprintln(ctx.Out, "Recording is not in progress.")
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// RecordPauseCmd pauses the recording.
|
// RecordPauseCmd pauses the recording.
|
||||||
type RecordPauseCmd struct{} // size = 0x0
|
type RecordPauseCmd struct{} // size = 0x0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user