From 3d02a0b4c4733a0d151ff202cdb8fe3e57ce5a9b Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 1 Nov 2014 16:31:32 +0100 Subject: [PATCH] added Coedit custom tool example --- .../test/coeditproj/googlesearchdlang.coedit | 22 +++++++++++++++++++ lazproj/test/src/googlesearch.d | 21 ++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 lazproj/test/coeditproj/googlesearchdlang.coedit create mode 100644 lazproj/test/src/googlesearch.d diff --git a/lazproj/test/coeditproj/googlesearchdlang.coedit b/lazproj/test/coeditproj/googlesearchdlang.coedit new file mode 100644 index 00000000..9bf08a0e --- /dev/null +++ b/lazproj/test/coeditproj/googlesearchdlang.coedit @@ -0,0 +1,22 @@ +object CurrentProject: TCEProject + OptionsCollection = < + item + name = 'release' + outputOptions.inlining = True + outputOptions.noBoundsCheck = False + outputOptions.boundsCheck = offAlways + outputOptions.optimizations = True + outputOptions.release = True + pathsOptions.outputFilename = 'googlesearch' + preBuildProcess.options = [] + preBuildProcess.showWindow = swoNone + postBuildProcess.options = [] + postBuildProcess.showWindow = swoNone + runOptions.options = [] + runOptions.showWindow = swoNone + end> + Sources.Strings = ( + '..\src\googlesearch.d' + ) + ConfigurationIndex = 0 +end diff --git a/lazproj/test/src/googlesearch.d b/lazproj/test/src/googlesearch.d new file mode 100644 index 00000000..ffa84fc2 --- /dev/null +++ b/lazproj/test/src/googlesearch.d @@ -0,0 +1,21 @@ +module googlesearch; + +/* +Coedit custom tool: +search some help about the current identifier. +executable: \googlesearch.exe +parameters: +*/ + +static const string prefix = "http://www.google.com/search?q=\"dlang.org+"; +static const string suffix = "&btnI=Im+Feeling+Lucky"; + +void main(string args[]) +{ + if (args.length == 1) + return; + + auto url = prefix ~ args[1]~ suffix; + import std.process: browse; + browse(url); +}