Add date/time flag to command and update functions

This commit is contained in:
Dan Jones 2026-03-01 08:52:59 -06:00
commit 21d27f8068
5 changed files with 13 additions and 10 deletions

View file

@ -27,6 +27,7 @@ import (
)
var outJson bool
var d mycli.Date
// YtDropCmd represents the drop command
var YtDropCmd = &cobra.Command{
@ -41,7 +42,7 @@ var YtDropCmd = &cobra.Command{
}
url := args[0]
log, err := ytdlp.Drop(cmd.Context(), url)
log, err := ytdlp.Drop(cmd.Context(), url, d.Time())
if err != nil {
return err
}
@ -64,6 +65,8 @@ var YtDropCmd = &cobra.Command{
}
func init() {
(&d).Set("now")
mycli.RootCmd.AddCommand(YtDropCmd)
YtDropCmd.Flags().VarP(&d, "date", "d", "Date for log entry")
YtDropCmd.Flags().BoolVarP(&outJson, "output_json", "o", false, "Output result as JSON")
}