Skip to content

Commit

Permalink
Handle all args
Browse files Browse the repository at this point in the history
  • Loading branch information
yousseb committed Apr 22, 2016
1 parent 3a9bab9 commit 8584d37
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions osx/Meld
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,17 @@ import subprocess
def getScriptPath():
return os.path.dirname(os.path.realpath(sys.argv[0]))

arglist = []

if len(sys.argv) > 1:
try:
arglist.append(os.path.abspath(sys.argv[1]));
except:
arglist.append(sys.argv[1])

if len(sys.argv) > 2:
try:
arglist.append(os.path.abspath(sys.argv[2]));
except:
arglist.append(sys.argv[2])

if len(sys.argv) > 3:
try:
arglist.append(os.path.abspath(sys.argv[3]));
except:
arglist.append(sys.argv[3])
arglist = []
for arg in sys.argv[1:]:
if arg.startswith('--output'):
filename = arg.split('=')[1]
newArg = '--output=' + os.path.abspath(filename)
elif arg.startswith('-'):
newArg = arg
else:
newArg = os.path.abspath(arg)
arglist.append(newArg)

MELDPATH = getScriptPath() + "/Meld-bin"
APPPATH = os.path.abspath(os.path.join(getScriptPath(), '..'))
Expand Down

0 comments on commit 8584d37

Please sign in to comment.