add some helpful messages to curl
command
This commit is contained in:
parent
ae81d8467c
commit
e79cd00a06
@ -129,7 +129,7 @@ const COMMANDS = [
|
|||||||
name: 'curl',
|
name: 'curl',
|
||||||
description: 'open website in new tab',
|
description: 'open website in new tab',
|
||||||
usage: '<website>',
|
usage: '<website>',
|
||||||
usage_examples: ['curl google.com'],
|
usage_examples: ['curl https://google.com'],
|
||||||
arguments: [
|
arguments: [
|
||||||
{
|
{
|
||||||
name: 'url',
|
name: 'url',
|
||||||
@ -138,7 +138,7 @@ const COMMANDS = [
|
|||||||
multiword: true,
|
multiword: true,
|
||||||
check: (url) => URL_REGEX.test(url)
|
check: (url) => URL_REGEX.test(url)
|
||||||
? null
|
? null
|
||||||
: "invalid URL"
|
: "invalid URL or missing protocol"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
output: (url) => {
|
output: (url) => {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
const URL_REGEX = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/;
|
const URL_REGEX = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g;
|
||||||
|
|
||||||
const LINKS = {
|
const LINKS = {
|
||||||
'gitea': 'https://git.sador.me/sadorowo',
|
'gitea': 'https://git.sador.me/sadorowo',
|
||||||
'instagram': 'https://instagram.com/sadorowo',
|
'instagram': 'https://instagram.com/sadorowo',
|
||||||
|
Loading…
Reference in New Issue
Block a user