Merge branch 'master' into ubuntu

This commit is contained in:
Petr Bena 2014-05-25 19:13:15 +02:00
commit cec0cbd749
6 changed files with 19 additions and 10 deletions

View File

@ -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

View File

@ -24,9 +24,10 @@ 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;
string Configuration::Input = "";
string Configuration::DefaultURL = "";

View File

@ -33,6 +33,7 @@ namespace Stikkit
static string DefaultURL;
static bool Private;
static string Home;
static bool NoExtras;
};
}

View File

@ -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
{

View File

@ -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++;
@ -131,15 +128,15 @@ bool TerminalParser::ParseChar(char x)
case 'p':
Configuration::Private = true;
return false;
case 's':
Configuration::NoExtras = true;
return false;
}
return false;
}
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"\
@ -149,6 +146,7 @@ void TerminalParser::DisplayHelp()
" -v: Increases verbosity\n"\
" -t <title>: 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"\

View File

@ -23,7 +23,6 @@ namespace Stikkit
bool Parse();
bool ParseChar(char x);
void DisplayHelp();
bool Silent;
private:
int argc;
char **argv;