]> jfr.im git - yt-dlp.git/blobdiff - devscripts/fish-completion.py
[cleanup] Fix misc bugs (#8968)
[yt-dlp.git] / devscripts / fish-completion.py
index a27ef44f8fe1474176291f69b31ff5a3ea46337c..5d2f68a489556ffedeb186ea00aa3b122000f775 100755 (executable)
@@ -1,19 +1,22 @@
-#!/usr/bin/env python
-from __future__ import unicode_literals
+#!/usr/bin/env python3
 
-import optparse
+# Allow direct execution
 import os
-from os.path import dirname as dirn
 import sys
 
-sys.path.insert(0, dirn(dirn((os.path.abspath(__file__)))))
-import youtube_dlc
-from youtube_dlc.utils import shell_quote
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+
+import optparse
+
+import yt_dlp
+from yt_dlp.utils import shell_quote
 
-FISH_COMPLETION_FILE = 'youtube-dlc.fish'
+FISH_COMPLETION_FILE = 'completions/fish/yt-dlp.fish'
 FISH_COMPLETION_TEMPLATE = 'devscripts/fish-completion.in'
 
 EXTRA_ARGS = {
+    'remux-video': ['--arguments', 'mp4 mkv', '--exclusive'],
     'recode-video': ['--arguments', 'mp4 flv ogg webm mkv', '--exclusive'],
 
     # Options that need a file parameter
@@ -30,7 +33,7 @@ def build_completion(opt_parser):
     for group in opt_parser.option_groups:
         for option in group.option_list:
             long_option = option.get_opt_string().strip('-')
-            complete_cmd = ['complete', '--command', 'youtube-dlc', '--long-option', long_option]
+            complete_cmd = ['complete', '--command', 'yt-dlp', '--long-option', long_option]
             if option._short_opts:
                 complete_cmd += ['--short-option', option._short_opts[0].strip('-')]
             if option.help != optparse.SUPPRESS_HELP:
@@ -45,5 +48,5 @@ def build_completion(opt_parser):
         f.write(filled_template)
 
 
-parser = youtube_dlc.parseOpts()[0]
+parser = yt_dlp.parseOpts(ignore_config_files=True)[0]
 build_completion(parser)