✨ Add date/time flag to command and update functions
This commit is contained in:
parent
b5c6c84a5d
commit
21d27f8068
5 changed files with 13 additions and 10 deletions
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue