>From the two possible WinGrass command lines (either cmd.exe or msys)
the following command will open the html index and returns the
terminal:

cmd /c "rundll32 url.dll,OpenURL "file:///C:/Program
Files/GRASS-6-SVN/docs/html/full_index.html""

I incorporated this into g.manual in a bit of an ugly fashion (see
attached patch), it works perfectly for msys but not for cmd. For cmd
it doesn't open the html and it doesn't return the terminal.
Hopefullly someone else can finish the task.

-Colin


On Wed, Jul 29, 2009 at 6:28 AM, Glynn Clements
<[email protected]> wrote:
>
> Hamish wrote:
>
>> For GRASS_HTML_BROWSER, it is read in a number of contexts by e.g.
>> by g.manual shell script (6.x), g.manual python (7.x), wxGUI,
>> tcl/tk GUI, grass-run.bat, gui startups, ...
>>
>> so it needs to be both cross-platform, cross-language, and cross-
>> environment (msys vs dos). thus IMO the only portable solution will
>> be to store it in the OS's native FS format and have each client
>> code translate downstream as needed rather than guess that up
>> front.
>
> That's all well and good, but we still aren't making any progress on
> the original question, i.e. what must the specified program accept as
> an argument?
>
> Until that's know, developers don't know how to use it, and users
> don't know how to set it.
>
>> I find msys to be too large complex to simply say "msys does or
>> does not support this or that" as a blanket statement.
>
> By "MSys", I mean the port of bash.
>
> --
> Glynn Clements <[email protected]>
>
Index: scripts/g.manual/g.manual
===================================================================
--- scripts/g.manual/g.manual	(revision 39119)
+++ scripts/g.manual/g.manual	(working copy)
@@ -76,7 +76,12 @@
     if [ -z "$GRASS_VERBOSE" ] || [ "$GRASS_VERBOSE" -gt 1 ] ; then
 	g.message "Starting browser <$BROWSERNAME> for module $1..."
     fi
-    "$GRASS_HTML_BROWSER" file://"$GRASS_DOC_BASE"/docs/html/$1.html
+    #hack for windows
+	if [ "$OS" = "Windows_NT" ] ; then
+		cmd /c "rundll32 url.dll,OpenURL "file://"$GRASS_DOC_BASE"/docs/html/$1.html""
+	else
+		"$GRASS_HTML_BROWSER" file://"$GRASS_DOC_BASE"/docs/html/$1.html
+	fi
   fi
 }
 
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to