refactor: arg parsing uses while loop

- safely handle parsing flags sequentially
- better support for -help
This commit is contained in:
2026-05-29 11:06:44 +05:30
parent bad09d22e1
commit f0578aabfa
4 changed files with 50 additions and 23 deletions

View File

@@ -4,6 +4,14 @@
#include <string.h>
bool has_video_extension(const char* path) {
/*
Check if the file extension of the given path matches common video formats.
*/
// TODO: Instead of checking file extension, use MIME type detection
// Check if the given path has an extension by looking for the last dot
// character.
const char* dot = strrchr(path, '.');
if (!dot || dot == path) {
return false;