-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
invoke-webrequest: add page #8177
Conversation
Co-authored-by: Axel Navarro <navarroaxel@gmail.com>
Co-authored-by: Axel Navarro <navarroaxel@gmail.com>
Co-authored-by: Axel Navarro <navarroaxel@gmail.com>
Hello! I've noticed something unusual when checking this PR:
Is this intended? If so, just ignore this comment. Otherwise, please double-check the commits. |
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new page! I've left some comments below for you to review.
@@ -0,0 +1,15 @@ | |||
# curl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will overwrite the existing curl
page in the common
platform.
@@ -0,0 +1,15 @@ | |||
# wget |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Let's remove these wget
and curl
pages from this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote these two pages for two reasons. First is the fact that in PowerShell for Windows, both commands will be substituted with Invoke-WebRequest
with incompatible set of accepted parameters when wget
or curl
is not visible on %PATH%
:
and similarly, executing curl
and wget
without additional subcommand or parameters will still return the same prompt with Invoke-WebRequest
if both aren't installed on %PATH%
:
As far as I know there are some edge cases where a command documentation is split between common
and OS-specific versions, e.g. common/cd
and windows/cd
. As long as tldr
clients still can show the common or platform-specific versions of the same command I still prefer to keep windows/curl
and windows/wget
this way to avoid confusion among those PowerShell users.
Ah I forgot that the original documentation should be accessed with tldr {{curl|wget}} --platform common
instead of tldr common/{{curl|wget}}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, thanks for clarifying this. This is a rather confusing situation, isn't it?
cmd.exe
is the main shell for Windows, which if you havecurl
orwget
installed works as on Linux- PowerShell is also an official shell distributed and enabled by default on Windows, where
curl
andwget
resolve →Invoke-WebRequest
- Someone should complain to Microsoft about this awfully confusing behaviour, since
curl
,wget
, andInvoke-WebRequest
all have incompatible arguments
With this in mind, your solution here seems to be the best option. Thanks for explaining - not being a Windows user I didn't understand at first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure about the curl
/wget
page, but the content looks fine.
It's not the most elegant solution, but I think the only option we have.
common/
,linux/
, etc.)Version of the command being documented (if known): 7.2.1
After quite a long hiatus I decided to contribute some more on PowerShell (and soon for Indonesian translations for macOS commands).
We have talked a lot about
Invoke-WebRequest
and "incompatible aliases" whencurl
andwget
are not installed in Windows. So I decided to create a special alias page for them, with a command to check which program (curl
/wget
orInvoke-WebRequest
) was used to evaluate thecurl
orwget
command, despite I'm afraid they won't pass the linter: