diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-13 12:42:31 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-13 12:42:31 +0200 |
commit | c12a9a09da59b9e418316dba02e6215cb55e47ee (patch) | |
tree | 05498d9a42e399bcca787f40c1fc473fb09e680e /sinksh/syntax_modules/sink_info.cpp | |
parent | 55fe06979ceebe67553135b43aa47e70d931304b (diff) | |
parent | ebdb89b8bb482bbb5ecd544c3d38bef35fc7d820 (diff) | |
download | sink-0.4.0.tar.gz sink-0.4.0.zip |
Merge commit 'ebdb89b8bb482bbb5ecd544c3d38bef35fc7d820'v0.4.0
Diffstat (limited to 'sinksh/syntax_modules/sink_info.cpp')
-rw-r--r-- | sinksh/syntax_modules/sink_info.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sinksh/syntax_modules/sink_info.cpp b/sinksh/syntax_modules/sink_info.cpp new file mode 100644 index 0000000..aa515e6 --- /dev/null +++ b/sinksh/syntax_modules/sink_info.cpp | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Christian Mollekopf <mollekopf@kolabsys.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | */ | ||
19 | |||
20 | #include <QDebug> | ||
21 | #include <QObject> // tr() | ||
22 | |||
23 | #include "common/definitions.h" | ||
24 | |||
25 | #include "sinksh_utils.h" | ||
26 | #include "state.h" | ||
27 | #include "syntaxtree.h" | ||
28 | #include "sink_version.h" | ||
29 | |||
30 | namespace SinkInfo | ||
31 | { | ||
32 | |||
33 | bool info(const QStringList &args, State &state) | ||
34 | { | ||
35 | state.printLine(QString("Sink version: %1").arg(sink_VERSION_STRING)); | ||
36 | state.printLine(QString("Storage location: %1").arg(Sink::storageLocation())); | ||
37 | state.printLine(QString("Data location: %1").arg(Sink::dataLocation())); | ||
38 | state.printLine(QString("Config location: %1").arg(Sink::configLocation())); | ||
39 | state.printLine(QString("Temporary file location: %1").arg(Sink::temporaryFileLocation())); | ||
40 | state.printLine(QString("Resource storage location: %1").arg(Sink::resourceStorageLocation("$RESOURCE"))); | ||
41 | return false; | ||
42 | } | ||
43 | |||
44 | Syntax::List syntax() | ||
45 | { | ||
46 | return Syntax::List() << Syntax{"info", QObject::tr("Shows general system info"), &SinkInfo::info, Syntax::NotInteractive}; | ||
47 | } | ||
48 | |||
49 | REGISTER_SYNTAX(SinkInfo) | ||
50 | |||
51 | } | ||