Skip to content

Commit 0c4b733

Browse files
committed
close labsquare#79
1 parent 375f7a5 commit 0c4b733

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

cli/cliparser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ void populateCLIParser(QCommandLineParser &parser)
3838
QCommandLineOption threadOption(QStringList() << "t" << "threads",
3939
QCoreApplication::tr("Specifies the number of files which can be processed simultaneously. Use by default all avaible CPU"),
4040
"threads");
41+
QCommandLineOption citeOption("cite",
42+
QCoreApplication::tr("Get in bibtex format to cite FastQt"));
4143

4244
// QCommandLineOption outImgFormatOption(QStringList() << "out-img-format",
4345
// QCoreApplication::tr("Specifies the format image output. By default value is \"svg\". Possible value is \"svg\" and \"png\"."),
@@ -47,5 +49,6 @@ void populateCLIParser(QCommandLineParser &parser)
4749

4850
parser.addOption(outputOption);
4951
parser.addOption(threadOption);
52+
parser.addOption(citeOption);
5053
// parser.addOption(outImgFormatOption);
5154
}

cli/maincli.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,27 @@ MainCLI::MainCLI(QCommandLineParser* parser, QObject *parent) : QEventLoop(paren
1010

1111
int MainCLI::exec()
1212
{
13+
// check cite option if is set return citation in bibtex format and stop
14+
if (mParser->isSet("cite"))
15+
{
16+
cout<<"@misc{FastQt,"<<endl;
17+
cout<<" author = {Labsquare Team et al},"<<endl;
18+
cout<<" title = {FastQt: a quality control tool for high throughput sequence data.},"<<endl;
19+
cout<<" year = {2017},"<<endl;
20+
cout<<" publisher = {GitHub},"<<endl;
21+
cout<<" journal = {GitHub repository},"<<endl;
22+
cout<<" howpublished = {\\url{https://github.com/labsquare/fastQt},"<<endl;
23+
cout<<" doi = {doi:10.5281/zenodo.824549}"<<endl;
24+
cout<<"}"<<endl;
25+
exit();
26+
return 0;
27+
}
1328

1429
if (mParser->positionalArguments().isEmpty())
1530
{
1631
qDebug()<<"No fastq provided";
17-
quit();
32+
exit();
33+
return 0;
1834
}
1935

2036
// QString tmp = mParser->value("out-img-format");

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
5858

5959
parser.process(a);
6060

61-
if(parser.positionalArguments().empty())
61+
if(parser.positionalArguments().empty() && !parser.isSet("cite"))
6262
{
6363
MainWindow window;
6464
window.show();

0 commit comments

Comments
 (0)