[gexiv2] tools: Promote gexiv2-dump to a tool
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gexiv2] tools: Promote gexiv2-dump to a tool
- Date: Sat, 19 Jan 2019 09:04:12 +0000 (UTC)
commit a496f36d081a26939bcd05b9b4d4b09c1047feca
Author: Jens Georg <mail jensge org>
Date: Sat Jan 19 09:58:06 2019 +0100
tools: Promote gexiv2-dump to a tool
meson.build | 4 ++++
meson_options.txt | 1 +
test/meson.build | 8 --------
{test => tools}/gexiv2-dump.vala | 8 +++-----
tools/meson.build | 7 +++++++
5 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/meson.build b/meson.build
index 209b3e9..f9b93b4 100644
--- a/meson.build
+++ b/meson.build
@@ -62,3 +62,7 @@ if introspection_available
endif
subdir('test')
+
+if get_option('tools')
+ subdir('tools')
+endif
diff --git a/meson_options.txt b/meson_options.txt
index 8df8a49..8dd0319 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,6 @@
option('gtk_doc', type: 'boolean', value: false, description: 'Enable or disable generating the API
reference (depends on GTK-Doc)')
option('introspection', type: 'boolean', value : true, description: 'Enable or disable GObject
Introspection')
option('vapi', type: 'boolean', value: true, description: 'Enable or disable generation of vala vapi file')
+option('tools', type: 'boolean', value: true, description: 'Enable or disable building the commandline
tools')
option('python2_girdir', type: 'string', value : 'auto', description : 'Installation dir for PyGObject2
overrides (default = auto, no disables python2)')
option('python3_girdir', type: 'string', value : 'auto', description : 'Installation dir for PyGObject3
overrides (default = auto, no disables python3)')
diff --git a/test/meson.build b/test/meson.build
index 9e99477..c95e429 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -16,14 +16,6 @@ regression_test = executable('gexiv2-regression', 'gexiv2-regression.c',
test('regression', regression_test, env : test_env)
-if vapi_available
- executable('gexiv2-dump',
- 'gexiv2-dump.vala',
- include_directories : include_directories('..'),
- dependencies : [gobject, vapi, gio],
- link_with : gexiv2)
-endif
-
if python2_available
python2_test_conf = configuration_data()
python2_test_conf.set('PYTHON2_PATH', python2.path())
diff --git a/test/gexiv2-dump.vala b/tools/gexiv2-dump.vala
similarity index 81%
rename from test/gexiv2-dump.vala
rename to tools/gexiv2-dump.vala
index 0dc7724..0532c64 100644
--- a/test/gexiv2-dump.vala
+++ b/tools/gexiv2-dump.vala
@@ -18,8 +18,7 @@ int main(string[] args) {
foreach (string filename in args[1:args.length]) {
try {
GExiv2.Metadata metadata = new GExiv2.Metadata();
-// metadata.open_path(filename);
- var file = File.new_for_path (filename);
+ var file = File.new_for_commandline_arg (filename);
metadata.from_stream (file.read ());
dump_tags(metadata, metadata.get_exif_tags());
@@ -34,14 +33,13 @@ int main(string[] args) {
}
void usage() {
- stdout.printf("usage: gexiv2-dump FILE...\n\n");
+ print("usage: gexiv2-dump FILE...\n\n");
}
void dump_tags(GExiv2.Metadata metadata, string[] tags) throws Error {
foreach (string tag in tags) {
- stdout.printf("%s%*s%s\n",
+ print("%-64s%s\n",
tag,
- (64 - tag.length).clamp(1, 64), "",
metadata.get_tag_interpreted_string(tag)
);
}
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 0000000..4ab697d
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1,7 @@
+if vapi_available
+ executable('gexiv2-dump',
+ 'gexiv2-dump.vala',
+ include_directories : include_directories('..'),
+ dependencies : [gobject, vapi, gio],
+ link_with : gexiv2)
+endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]