summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile19
-rw-r--r--queryt.154
-rw-r--r--queryt.c4
3 files changed, 73 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 9e5dbf5..08ca1f5 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,9 @@
# Source Code
SRC = queryt.c src/utils.c src/video.c libs/curl.c libs/string.c libs/json.c
+# Compiler Flags
+FLAGS = -march=native -O3 -pipe -faggressive-loop-optimizations
+
# Libraries
LIBS = -lcurl -ljson-c
@@ -12,10 +15,22 @@ CLEAN = queryt
# MakeOPTS
build: clean
- cc -o queryt ${SRC} ${LIBS}
+ cc -o queryt ${FLAGS} ${SRC} ${LIBS}
debug: clean
- cc -g -o queryt ${SRC} ${LIBS}
+ cc -g -o queryt_debug ${FLAGS} ${SRC} ${LIBS}
clean:
rm -rf ${CLEAN}
+
+install: build
+ mkdir -p /usr/local/bin
+ cp -f queryt /usr/local/bin
+ chmod 755 /usr/local/bin
+ mkdir -p /usr/local/share/man/man1
+ cp -f queryt.1 /usr/local/share/man/man1
+ chmod 644 /usr/local/share/man/man1/queryt.1
+
+uninstall:
+ rm -rf /usr/local/bin/queryt
+ rm -f /usr/local/share/man/man1/queryt.1
diff --git a/queryt.1 b/queryt.1
new file mode 100644
index 0000000..4b507e1
--- /dev/null
+++ b/queryt.1
@@ -0,0 +1,54 @@
+.TH QUERYT "1" "September 2021" "QUERYT 1.0" "User Commands"
+.SH NAME
+queryt \- API keyless YouTube querying tool.
+.SH SYNOPSIS
+.B queryt -s
+[\fI\,SEARCH\/\fR]... [\fI\,OPTIONS\/\fR]...
+.SH DESCRIPTION
+.PP
+Query various searches from YouTube to standard output.
+.TP
+\fB\-f\fR, \fB\-\-format\fR
+uses format modifiers to customize the output \fB[aditRT]\fR
+.TP
+\fB\-m\fR, \fB\-\-max\fR
+defines the max number of displayed results\fR
+.TP
+\fB\-s\fR, \fB\-\-search\fR
+search content on youtube\fR
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+display this help and exit
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+output version information and exit
+.SH FORMAT MODIFIERS
+.TP
+\fBa\fR
+author
+.TP
+\fBd\fR
+duration or video length
+.TP
+\fBi\fR
+video id
+.TP
+\fBt\fR
+title
+.TP
+\fBR\fR
+return
+.TP
+\fBT\fR
+tab
+.SH EXAMPLES
+.TP
+queryt -s "Never Gonna Give You Up" -m 5 -f iTaTdRt
+.TP
+Search for the video "Never Gonna Give You Up" sets the max results to 5 and formats it by showing the information by this order:
+.TP
+[video id] \fItab\fR [author] \fItab\fR [duration] \fIreturn\fR [title]
+.SH AUTHOR
+Written by Rafael Marçalo 2021.
+.SH LICENSE
+GPLv3
diff --git a/queryt.c b/queryt.c
index fb4e918..edf9d01 100644
--- a/queryt.c
+++ b/queryt.c
@@ -128,8 +128,8 @@ void processOptions(int *options, char **args, int argc)
if ( options[1] || (options[3] && options[4]) || argc == 1)
{
printf("Usage: queryt -s [SEARCH]... [OPTIONS]...\n"
- "Make youtube querys without authentication or API Key\n\n"
- " -f, --format format the output query with with custom modifiers\n"
+ "API Keyless YouTube querying tool.\n\n"
+ " -f, --format uses format modifiers to customize the output\n"
" a author;\n"
" d duration;\n"
" i video id;\n"