update documentation

This commit is contained in:
ari melody 2026-06-28 16:37:42 +01:00
parent 0abafd26c5
commit 75534da702
Signed by: ari
GPG key ID: 60B5F0386E3DDB7E
3 changed files with 43 additions and 51 deletions

45
main.go
View file

@ -30,11 +30,6 @@ const SEGMENT_EXTENSION = "mkv"
const MAX_TITLE_LEN = 100
const MAX_DESCRIPTION_LEN = 5000
func showHelp() {
fmt.Println(helpText)
os.Exit(0)
}
func main() {
ctx := context.Background()
@ -65,18 +60,13 @@ func main() {
os.Exit(0)
}
// arguments
if len(os.Args) < 2 || os.Args[1] == "--help" || os.Args[1] == "-h" {
showHelp()
}
var verbose bool = false
var initDirectory bool = false
var logout bool = false
var keepFullVOD bool = false
var keepConcatVOD bool = false
var forceUpload bool = false
var dryRun bool = false
var directory string = "."
var directory string = ""
for i, arg := range os.Args {
if i == 0 { continue }
@ -86,31 +76,29 @@ func main() {
case "-h":
fallthrough
case "--help":
showHelp()
log.Fatal(helpText)
case "-v":
fallthrough
case "--verbose":
verbose = true
case "--init":
initDirectory = true
case "--logout":
logout = true
case "-d":
fallthrough
case "--keep-vod":
keepFullVOD = true
case "--dry-run":
dryRun = true
case "-f":
fallthrough
case "--force":
forceUpload = true
case "--dry-run":
dryRun = true
case "--init":
initDirectory = true
case "--keep-vod":
keepConcatVOD = true
case "--logout":
logout = true
default:
fmt.Fprintf(os.Stderr, "Unknown option `%s`\n", arg)
@ -135,8 +123,7 @@ func main() {
if err != nil {
log.Fatalf("Failed to write config: %v", err)
}
log.Println("Logged out successfully.")
os.Exit(0)
log.Fatalf("Logged out successfully.")
}
// initialising directory (--init)
@ -393,9 +380,9 @@ func main() {
log.Fatalf("Failed to update metadata: %v", err)
}
// delete full VOD after upload, if requested
// delete concatenated VOD after upload, unless specified otherwise
// if len(vodFiles) == 1, the full VOD is the *only* VOD. do not delete this!!!
if len(vodFiles) > 1 && !keepFullVOD {
if len(vodFiles) > 1 && !keepConcatVOD {
if err = os.Remove(videoMeta.Filepath); err != nil {
log.Fatalf("Failed to delete full VOD: %v", err)
}