mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-09-23 23:30:11 +00:00
[core] Warn user when not launching through shell on Windows (#9250)
Authored by: seproDev, Grub4K Co-authored-by: Simon Sawicki <contact@grub4k.xyz>
This commit is contained in:
@@ -196,9 +196,12 @@ class _YoutubeDLOptionParser(optparse.OptionParser):
|
||||
raise
|
||||
return self.check_values(self.values, self.largs)
|
||||
|
||||
def error(self, msg):
|
||||
def _generate_error_message(self, msg):
|
||||
msg = f'{self.get_prog_name()}: error: {str(msg).strip()}\n'
|
||||
raise optparse.OptParseError(f'{self.get_usage()}\n{msg}' if self.usage else msg)
|
||||
return f'{self.get_usage()}\n{msg}' if self.usage else msg
|
||||
|
||||
def error(self, msg):
|
||||
raise optparse.OptParseError(self._generate_error_message(msg))
|
||||
|
||||
def _get_args(self, args):
|
||||
return sys.argv[1:] if args is None else list(args)
|
||||
|
Reference in New Issue
Block a user