aboutsummaryrefslogtreecommitdiffstats
path: root/src/0001-Added-support-for-long-arguments.patch
diff options
context:
space:
mode:
Diffstat (limited to 'src/0001-Added-support-for-long-arguments.patch')
-rw-r--r--src/0001-Added-support-for-long-arguments.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/0001-Added-support-for-long-arguments.patch b/src/0001-Added-support-for-long-arguments.patch
new file mode 100644
index 0000000..aa0d590
--- /dev/null
+++ b/src/0001-Added-support-for-long-arguments.patch
@@ -0,0 +1,63 @@
+From ac0d9ae25dd487f7cafbda8152753dfe09696399 Mon Sep 17 00:00:00 2001
+From: lovelace <lovelace@kinl.gq>
+Date: Wed, 27 Oct 2021 00:59:09 +0000
+Subject: [PATCH] Added support for long arguments
+
+---
+ src/main.c | 32 ++++++++++++++++++++++----------
+ 1 file changed, 22 insertions(+), 10 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index 4f30290..097fc51 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -41,14 +41,14 @@ usage(const char *progname)
+ void
+ help()
+ {
+- puts("-s: status to post");
+- puts("-F: filename to be attatched with the post");
+- puts("-v: The visibility which the post will have, can be: public, "
+- "unlisted, private and direct");
+- puts("-f: Follow an account");
+- puts("-u: Unfollow an account");
+- puts("-U: prints usage message");
+- puts("-h: prints this help message");
++ puts("-s, --status: status to post");
++ puts("-F, --filename: filename to be attatched with the post");
++ puts("-v, --visibility: The visibility which the post will have, can"
++ "be: public unlisted, private and direct");
++ puts("-f, --follow: Follow an account");
++ puts("-u, --unfollow: Unfollow an account");
++ puts("-U, --usage: prints usage message");
++ puts("-h, --help: prints this help message");
+ }
+
+ /* prints a string to stderr */
+@@ -79,9 +79,21 @@ main(int argc, char **argv)
+ return -1;
+ }
+
+- while((c = getopt(argc, argv, "s:v:F:f:u:hU")) != -1) {
++ int option_index = 0;
++ static struct option long_options[] = {
++ {"status", required_argument, 0, 's'},
++ {"filename", required_argument, 0, 'F'},
++ {"visibility", required_argument, 0, 'v'},
++ {"follow", required_argument, 0, 'f'},
++ {"unfollow", required_argument, 0, 'u'},
++ {"usage", no_argument, 0, 'U'},
++ {"help", no_argument, 0, 'h'},
++ {0, 0, 0, 0}
++ };
++
++ while((c = getopt_long(argc, argv, "s:v:F:f:u:hU", long_options, &option_index)) != -1) {
+ switch(c) {
+- case 's':
++ case 's':
+ status = optarg;
+ break;
+ case 'v':
+--
+2.33.1
+