summaryrefslogtreecommitdiffstats
path: root/sinksh/syntax_modules/sink_info.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sinksh/syntax_modules/sink_info.cpp')
-rw-r--r--sinksh/syntax_modules/sink_info.cpp49
1 files changed, 49 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..5f535eb
--- /dev/null
+++ b/sinksh/syntax_modules/sink_info.cpp
@@ -0,0 +1,49 @@
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
29namespace SinkInfo
30{
31
32bool info(const QStringList &args, State &state)
33{
34 state.printLine(QString("Storage location: %1").arg(Sink::storageLocation()));
35 state.printLine(QString("Data location: %1").arg(Sink::dataLocation()));
36 state.printLine(QString("Config location: %1").arg(Sink::configLocation()));
37 state.printLine(QString("Temporary file location: %1").arg(Sink::temporaryFileLocation()));
38 state.printLine(QString("Resource storage location: %1").arg(Sink::resourceStorageLocation("$RESOURCE")));
39 return false;
40}
41
42Syntax::List syntax()
43{
44 return Syntax::List() << Syntax{"info", QObject::tr("Shows general system info"), &SinkInfo::info, Syntax::NotInteractive};
45}
46
47REGISTER_SYNTAX(SinkInfo)
48
49}