Add long options for misc and network (#10753)

This commit is contained in:
Hofer-Julian
2023-10-19 18:16:44 +02:00
committed by GitHub
parent adb99938f7
commit 5f2089a15b
9 changed files with 29 additions and 26 deletions

View File

@ -60,7 +60,7 @@ impl Command for Tutor {
},
Example {
description: "Search a tutorial by phrase",
example: "tutor -f \"$in\"",
example: "tutor --find \"$in\"",
result: None,
},
]

View File

@ -115,23 +115,23 @@ impl Command for SubCommand {
},
Example {
description: "http delete from example.com, with username and password",
example: "http delete -u myuser -p mypass https://www.example.com",
example: "http delete --user myuser --password mypass https://www.example.com",
result: None,
},
Example {
description: "http delete from example.com, with custom header",
example: "http delete -H [my-header-key my-header-value] https://www.example.com",
example: "http delete --headers [my-header-key my-header-value] https://www.example.com",
result: None,
},
Example {
description: "http delete from example.com, with body",
example: "http delete -d 'body' https://www.example.com",
example: "http delete --data 'body' https://www.example.com",
result: None,
},
Example {
description: "http delete from example.com, with JSON body",
example:
"http delete -t application/json -d { field: value } https://www.example.com",
"http delete --content-type application/json --data { field: value } https://www.example.com",
result: None,
},
]

View File

@ -110,17 +110,17 @@ impl Command for SubCommand {
},
Example {
description: "Get content from example.com, with username and password",
example: "http get -u myuser -p mypass https://www.example.com",
example: "http get --user myuser --password mypass https://www.example.com",
result: None,
},
Example {
description: "Get content from example.com, with custom header",
example: "http get -H [my-header-key my-header-value] https://www.example.com",
example: "http get --headers [my-header-key my-header-value] https://www.example.com",
result: None,
},
Example {
description: "Get content from example.com, with custom headers",
example: "http get -H [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com",
example: "http get --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com",
result: None,
},
]

View File

@ -94,12 +94,13 @@ impl Command for SubCommand {
},
Example {
description: "Get headers from example.com, with username and password",
example: "http head -u myuser -p mypass https://www.example.com",
example: "http head --user myuser --password mypass https://www.example.com",
result: None,
},
Example {
description: "Get headers from example.com, with custom header",
example: "http head -H [my-header-key my-header-value] https://www.example.com",
example:
"http head --headers [my-header-key my-header-value] https://www.example.com",
result: None,
},
]

View File

@ -98,22 +98,22 @@ impl Command for SubCommand {
},
Example {
description: "Get options from example.com, with username and password",
example: "http options -u myuser -p mypass https://www.example.com",
example: "http options --user myuser --password mypass https://www.example.com",
result: None,
},
Example {
description: "Get options from example.com, with custom header",
example: "http options -H [my-header-key my-header-value] https://www.example.com",
example: "http options --headers [my-header-key my-header-value] https://www.example.com",
result: None,
},
Example {
description: "Get options from example.com, with custom headers",
example: "http options -H [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com",
example: "http options --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com",
result: None,
},
Example {
description: "Simulate a browser cross-origin preflight request from www.example.com to media.example.com",
example: "http options https://media.example.com/api/ -H [Origin https://www.example.com Access-Control-Request-Headers \"Content-Type, X-Custom-Header\" Access-Control-Request-Method GET]",
example: "http options https://media.example.com/api/ --headers [Origin https://www.example.com Access-Control-Request-Headers \"Content-Type, X-Custom-Header\" Access-Control-Request-Method GET]",
result: None,
},
]

View File

@ -111,17 +111,19 @@ impl Command for SubCommand {
},
Example {
description: "Patch content to example.com, with username and password",
example: "http patch -u myuser -p mypass https://www.example.com 'body'",
example:
"http patch --user myuser --password mypass https://www.example.com 'body'",
result: None,
},
Example {
description: "Patch content to example.com, with custom header",
example: "http patch -H [my-header-key my-header-value] https://www.example.com",
example:
"http patch --headers [my-header-key my-header-value] https://www.example.com",
result: None,
},
Example {
description: "Patch content to example.com, with JSON body",
example: "http patch -t application/json https://www.example.com { field: value }",
example: "http patch --content-type application/json https://www.example.com { field: value }",
result: None,
},
]

View File

@ -111,17 +111,17 @@ impl Command for SubCommand {
},
Example {
description: "Post content to example.com, with username and password",
example: "http post -u myuser -p mypass https://www.example.com 'body'",
example: "http post --user myuser --password mypass https://www.example.com 'body'",
result: None,
},
Example {
description: "Post content to example.com, with custom header",
example: "http post -H [my-header-key my-header-value] https://www.example.com",
example: "http post --headers [my-header-key my-header-value] https://www.example.com",
result: None,
},
Example {
description: "Post content to example.com, with JSON body",
example: "http post -t application/json https://www.example.com { field: value }",
example: "http post --content-type application/json https://www.example.com { field: value }",
result: None,
},
]

View File

@ -111,17 +111,17 @@ impl Command for SubCommand {
},
Example {
description: "Put content to example.com, with username and password",
example: "http put -u myuser -p mypass https://www.example.com 'body'",
example: "http put --user myuser --password mypass https://www.example.com 'body'",
result: None,
},
Example {
description: "Put content to example.com, with custom header",
example: "http put -H [my-header-key my-header-value] https://www.example.com",
example: "http put --headers [my-header-key my-header-value] https://www.example.com",
result: None,
},
Example {
description: "Put content to example.com, with JSON body",
example: "http put -t application/json https://www.example.com { field: value }",
example: "http put --content-type application/json https://www.example.com { field: value }",
result: None,
},
]