From ec4750b5e2f801fec7e1100299114483d4a04f4e Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Sat, 26 Oct 2024 20:59:35 +0200 Subject: Use getopt-based parser for command-line arguments Upcoming commits will want to make use of bespoke argument handling alongside subcommands and using Python's argparse proved unable to easily handle that kind of complexity. Therefore switch to the more basic getopt-based parser with which we can implement our own logic. Without argparse we're no longer bound to having an autogenerated help listing, so stop mentioning that in the manual. Instead have later(1) output a concise usage listing when given an unknown argument. Since we'll be adding more commands to later(1) in the future, also specify an explicit "list" command. --- later.1 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'later.1') diff --git a/later.1 b/later.1 index 4464da5..a4be6b0 100644 --- a/later.1 +++ b/later.1 @@ -1,4 +1,4 @@ -.Dd September 20, 2024 +.Dd October 26, 2024 .Dt LATER 1 .Os .Sh NAME @@ -6,12 +6,11 @@ .Nd list mpv's watch_later entries .Sh SYNOPSIS .Nm -.Op Fl u | \-update-titles -.Nm -.Fl h | \-help +.Op options +.Op Ic list .Sh DESCRIPTION .Nm -lists all watch_later entries as saved by +is a program to manage watch_later entries as created by .Xr mpv 1 . .Pp In order to display file names and URLs for an entry, the @@ -19,12 +18,17 @@ In order to display file names and URLs for an entry, the option must be set in .Xr mpv 1 . .Pp -The options are as follows: +The following options can be given for any command: .Bl -tag -width "-h, --update-titles" .It Fl u , Fl \-update-titles update titles of videos using yt-dlp -.It Fl h , Fl \-help -show a concise help message +.El +.Pp +The commands are as follows: +.Bl -tag -width Ds +.It Sy list +Lists all watch_later entries. +This command is implied if there are no remaining arguments. .El .Sh FILES .Bl -tag -width "1" -- cgit v1.2.3-2-gb3c3