From 1fe452a147ed6a7e77a4d03ec4ce5fc8a4bd3d63 Mon Sep 17 00:00:00 2001 From: Keuin Date: Thu, 8 Sep 2022 14:03:00 +0800 Subject: Remove redundant ".". Better default values. --- main.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index dc08359..bf12042 100644 --- a/main.go +++ b/main.go @@ -33,30 +33,33 @@ func getTasks() (tasks []recording.TaskConfig) { "c", "config", &argparse.Options{ Required: false, - Help: "Specify which configuration file to use. JSON, TOML and YAML are all supported.", + Help: "Specify which configuration file to use. JSON, TOML and YAML are all supported", }, ) rooms := parser.IntList( "s", "room", &argparse.Options{ Required: false, - Help: "The room id to record. Set this to run without config file", + Help: "Specify which room to record. " + + "The ID is included in bilibili live webpage url. " + + "Set this to run without config file", }, ) saveToPtr := parser.String( "o", "save-to", &argparse.Options{ Required: false, - Help: "Specify which configuration file to use", - Default: ".", + Help: "Specify the directory where to save records. " + + "If not set, process working directory is used", }, ) diskBufSizePtr := parser.Int( "b", "disk-write-buffer", &argparse.Options{ Required: false, - Help: "Specify disk write buffer size (bytes). The real minimum buffer size is determined by OS", - Default: -1, + Help: "Specify disk write buffer size (bytes). " + + "The real minimum buffer size is determined by OS", + Default: 4194304, }, ) @@ -107,7 +110,7 @@ func getTasks() (tasks []recording.TaskConfig) { // generate task list from cli taskCount := len(*rooms) tasks = make([]recording.TaskConfig, taskCount) - saveTo := *saveToPtr + saveTo := common.Zeroable[string](*saveToPtr).OrElse(".") diskBufSize := *diskBufSizePtr for i := 0; i < taskCount; i++ { tasks[i] = recording.TaskConfig{ -- cgit v1.2.3