mirror of
				https://github.com/onyx-and-iris/gobs-cli.git
				synced 2025-10-31 13:21:51 +00: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 | ||||||
|  | |||||||
							
								
								
									
										34
									
								
								record.go
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								record.go
									
									
									
									
									
								
							| @ -6,11 +6,12 @@ import ( | |||||||
| 
 | 
 | ||||||
| // RecordCmd handles the recording commands. | // RecordCmd handles the recording commands. | ||||||
| type RecordCmd struct { | 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"` | ||||||
| 	Pause  RecordPauseCmd  `cmd:"" help:"Pause recording."  aliases:"p"` | 	Status RecordStatusCmd `cmd:"" help:"Show recording status." aliases:"ss"` | ||||||
| 	Resume RecordResumeCmd `cmd:"" help:"Resume recording." aliases:"r"` | 	Pause  RecordPauseCmd  `cmd:"" help:"Pause recording."       aliases:"p"` | ||||||
|  | 	Resume RecordResumeCmd `cmd:"" help:"Resume recording."      aliases:"r"` | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // RecordStartCmd starts the recording. | // RecordStartCmd starts the recording. | ||||||
| @ -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