From 7309ccb1850483707a966be243a020c875be2c11 Mon Sep 17 00:00:00 2001 From: Petr Bena Date: Sun, 25 May 2014 18:41:09 +0200 Subject: [PATCH 1/5] tip --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 8a25340..8403c68 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,10 @@ echo "Hello world" | stikkit url is an url to stikked server for example, if your server is http://something.blah/stikked and your api is http://something.blah/stikked/api then use http://something.blah/stikked as parameter to -b The url parameter can be stored to configuration file (stikkit will ask you in case there is none in config file) + +Tips +===== + +Do you have a server and want to setup default pastebin site for all users in system? + +Create /etc/stikkit/url which contains the url of default pastebin site. Users will be able to override it, but by default everyone on system will use this From 1f35bb9cb6d1c084364d0ec5e16521def7b56a55 Mon Sep 17 00:00:00 2001 From: Petr Bena Date: Sun, 25 May 2014 18:47:33 +0200 Subject: [PATCH 2/5] no extras --- stikkit/configuration.cpp | 1 + stikkit/configuration.hpp | 1 + stikkit/main.cpp | 5 ++++- stikkit/terminalparser.cpp | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/stikkit/configuration.cpp b/stikkit/configuration.cpp index fd63f23..5913fa3 100644 --- a/stikkit/configuration.cpp +++ b/stikkit/configuration.cpp @@ -27,6 +27,7 @@ string Configuration::Author = ""; string Configuration::Version = "1.0.4"; string Configuration::Title = ""; string Configuration::Home = ""; +bool Configuration::NoExtras = false; string Configuration::Input = ""; string Configuration::DefaultURL = ""; diff --git a/stikkit/configuration.hpp b/stikkit/configuration.hpp index bfefb10..5cb2dc9 100644 --- a/stikkit/configuration.hpp +++ b/stikkit/configuration.hpp @@ -33,6 +33,7 @@ namespace Stikkit static string DefaultURL; static bool Private; static string Home; + static bool NoExtras; }; } diff --git a/stikkit/main.cpp b/stikkit/main.cpp index 45629bc..2366548 100644 --- a/stikkit/main.cpp +++ b/stikkit/main.cpp @@ -129,7 +129,10 @@ int main(int argc, char *argv[]) cerr << "curl_easy_perform() failed: " << curl_easy_strerror(res) << endl; return 12; } - cout << "Successfully pastebined to: " << readBuffer; + if (!Stikkit::Configuration::NoExtras) + cout << "Successfully pastebined to: " << readBuffer; + else + cout << readBuffer; curl_easy_cleanup(curl); } else { diff --git a/stikkit/terminalparser.cpp b/stikkit/terminalparser.cpp index a586c8d..d2e4c57 100644 --- a/stikkit/terminalparser.cpp +++ b/stikkit/terminalparser.cpp @@ -131,6 +131,9 @@ bool TerminalParser::ParseChar(char x) case 'p': Configuration::Private = true; return false; + case 's': + Configuration::NoExtras = true; + return false; } return false; } @@ -149,6 +152,7 @@ void TerminalParser::DisplayHelp() " -v: Increases verbosity\n"\ " -t : Set a title for a paste\n"\ " -p: Mark a paste as private (not visible in recent pastes)\n"\ + " -s: Display only RAW url of paste and no extra text\n"\ " -e <minutes>: Set expiry in minutes, parameter needs to be a number\n"\ " --version: Display a version\n"\ " -h | --help: Display this help\n\n"\ From 1088bdfe68a8f529800bee50c28fd1def02c928b Mon Sep 17 00:00:00 2001 From: Petr Bena <benapetr@gmail.com> Date: Sun, 25 May 2014 19:07:41 +0200 Subject: [PATCH 3/5] stupid bug --- stikkit/terminalparser.cpp | 3 --- stikkit/terminalparser.hpp | 1 - 2 files changed, 4 deletions(-) diff --git a/stikkit/terminalparser.cpp b/stikkit/terminalparser.cpp index d2e4c57..a4482b5 100644 --- a/stikkit/terminalparser.cpp +++ b/stikkit/terminalparser.cpp @@ -140,9 +140,6 @@ bool TerminalParser::ParseChar(char x) void TerminalParser::DisplayHelp() { - if (this->Silent) - return; - cout << "Stikkit - open source pastebin uploader for Stikked\n\n"\ "Parameters:\n"\ " -a <name>: Specify author name by default the current\n"\ diff --git a/stikkit/terminalparser.hpp b/stikkit/terminalparser.hpp index 8bc148d..f53cb70 100644 --- a/stikkit/terminalparser.hpp +++ b/stikkit/terminalparser.hpp @@ -23,7 +23,6 @@ namespace Stikkit bool Parse(); bool ParseChar(char x); void DisplayHelp(); - bool Silent; private: int argc; char **argv; From 878529f07cc6259f4307b9d32fa60a5ab4667407 Mon Sep 17 00:00:00 2001 From: Petr Bena <benapetr@gmail.com> Date: Sun, 25 May 2014 19:08:15 +0200 Subject: [PATCH 4/5] bug --- stikkit/terminalparser.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stikkit/terminalparser.cpp b/stikkit/terminalparser.cpp index a4482b5..d608c25 100644 --- a/stikkit/terminalparser.cpp +++ b/stikkit/terminalparser.cpp @@ -107,10 +107,7 @@ bool TerminalParser::Parse() } if (!valid) { - if (!this->Silent) - { - cerr << "This parameter isn't valid: " << text << endl; - } + cerr << "This parameter isn't valid: " << text << endl; return true; } x++; From 42741a9add353c9ed5a1082abef8e36893627340 Mon Sep 17 00:00:00 2001 From: Petr Bena <benapetr@gmail.com> Date: Sun, 25 May 2014 19:12:37 +0200 Subject: [PATCH 5/5] new version --- stikkit/configuration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stikkit/configuration.cpp b/stikkit/configuration.cpp index 5913fa3..cf9788f 100644 --- a/stikkit/configuration.cpp +++ b/stikkit/configuration.cpp @@ -24,7 +24,7 @@ string Configuration::URL = ""; string Configuration::Expiry = "60"; bool Configuration::Private = false; string Configuration::Author = ""; -string Configuration::Version = "1.0.4"; +string Configuration::Version = "1.0.5"; string Configuration::Title = ""; string Configuration::Home = ""; bool Configuration::NoExtras = false;