Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--referer is misspelled; should be --referrer, or tell the user what they did wrong #26314

Closed
ZevEisenberg opened this issue Aug 12, 2020 · 2 comments

Comments

@ZevEisenberg
Copy link

@ZevEisenberg ZevEisenberg commented Aug 12, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.07.28
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

youtube-dl -v --referrer "whatever" "https://www.youtube.com/watch\?v\=0k3l9IqsbTs"
Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: no such option: --referrer

Description

The --referer parameter is a possibly intentional misspelling of the English word "referrer". When typing a command, an inexperienced user may not notice the misspelling, spell the word "correctly" (i.e. not the way youtube-dl spells it), and be confused by the error message: error: no such option: --referrer.

youtube-dl should either accept --referrer as an alias to --referer, since it's clear what the user wanted to do, or should give a more helpful error message, such as did you mean --referer?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 12, 2020

This is intentional. Also neither wget nor curl have such an alias.

@dstftw dstftw closed this Aug 12, 2020
@ZevEisenberg
Copy link
Author

@ZevEisenberg ZevEisenberg commented Aug 12, 2020

This seems like an unwelcoming approach to newcomers of the software. If you can take what the user typed and figure out, unambiguously, what they meant, why not help them out?

I also think wget and curl should either add aliases, or add a general flag spell-checker, for the same reason.

I can't believe I'm about to use Git as an example of good user experience, but it has a similar-command matcher in it. Watch what happens when I misspell a command:

$ git pul              
git: 'pul' is not a git command. See 'git --help'.

The most similar commands are
	pull
	push

Why do I care so much about referrer in particular? We don't always read words letter-by-letter. It could frustrate someone to an unreasonable degree to be told that --referrer isn't a valid command, when the man page said that --referer is, if they don't notice the spelling difference. CLIs are unapproachable enough without introducing diabolical traps like intentional spelling mistakes! Making someone notice an obscure (and intentional!) typo feels like a tech interview gone wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.