Off-Topic > SCM EXtensions

Abiword.scm command line bug

<< < (3/5) > >>

Jason W:
Thanks Rich, I will check those out.

curaga:
I don't think that would work with options or more than one file.

Rich:
Hi curaga
It was intended to handle abiword with one file name. Options and multiple files should be left to someone who
is better versed in scripting than I am.

Jason W:
The Portalbelinuxapps.org method of making portable apps seems to require launching from the .desktop icon, or by clicking the downloaded file, rather than having the flexibility of the command line and switches.  So likely this is a limitation to this kind of extension build.

I can't think of a method to overcome that, I have tried several tricks involving wrappers, but so far a no go.  But it would be nice to find a way to get around this.

uggla:
This should work (but kind of ugly code):


--- Code: ---#!/bin/sh
SAVE_ARGS=$*
pwd=`echo $PWD`/
options=`echo ' '${SAVE_ARGS} | grep -o -e '[[:space:]][\-]\{1,2\}[[:alnum:]_]\+' | tr '\n' ' '`

absolutefiles=`echo ' '${SAVE_ARGS} | grep -o -e '[[:space:]]/[[:alnum:][:punct:]_/\-]\+' | tr '\n' `
if [ `expr length ' '"${absolutefiles}"` != 1 ]; then
absolutefiles=`echo ${absolutefiles//' '/ \"}\" | tr ' ' \"`;
absolutefiles=${absolutefiles//'""'/\" \"};
fi

relativefiles=`echo ' '${SAVE_ARGS} | grep -o -e '[[:space:]][[:alnum:]_][[:alnum:][:punct:]_\-]\+' | tr '\n' `
if [ `expr length ' '"${relativefiles}"` != 1 ]; then
relativefiles=`echo ${relativefiles//' '/ \"${pwd}}\" | tr ' ' \"`;
relativefiles=${relativefiles//'""'/\" \"};
fi

cd /apps/abiword
export LD_LIBRARY_PATH="local/lib"
export PATH="local/bin:$PATH"

/apps/abiword/abiword ${options} ${relativefiles} ${absolutefiles}

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version