projects
/
pyfrprog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fabfc9c
)
added version option
author
Bernhard Urban
<lewurm@gmx.net>
Sun, 31 Jan 2010 00:06:10 +0000
(
01:06
+0100)
committer
Bernhard Urban
<lewurm@gmx.net>
Sun, 31 Jan 2010 00:09:16 +0000
(
01:09
+0100)
Makefile
patch
|
blob
|
history
frprog.py
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index 9f3c3b96381389bd8caf1c5459528ef21311aad0..43ae795e9afadce11ed4d5a29bbaf6cfbe893322 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-5,7
+5,7
@@
all:
#install: all #this just work when $FUJDEV is set for root too, eh?
install:
#install: all #this just work when $FUJDEV is set for root too, eh?
install:
- sed -e 's/%PREFIX%/\$(PREFIX)/g' frprog.py > $(PREFIX)/bin/frprog
+ sed -e 's/%PREFIX%/\$(PREFIX)/g' frprog.py
| sed -e 's/%VERSION%/$(shell git describe --abbrev=6)/g'
> $(PREFIX)/bin/frprog
cp SerialPort_linux.pyc $(PREFIX)/bin/SerialPort_linux.pyc
mkdir -p $(PREFIX)/share/frprog/
cp pkernel/pkernel.mhx $(PREFIX)/share/frprog/pkernel.mhx
cp SerialPort_linux.pyc $(PREFIX)/bin/SerialPort_linux.pyc
mkdir -p $(PREFIX)/share/frprog/
cp pkernel/pkernel.mhx $(PREFIX)/share/frprog/pkernel.mhx
diff --git
a/frprog.py
b/frprog.py
index ab8aba66bc8b71c869829e6c379fa1ed9fdc2cee..d99f48fc63cd87be463da9f795ebfda2b0b820d0 100755
(executable)
--- a/
frprog.py
+++ b/
frprog.py
@@
-181,6
+181,11
@@
def main(argv=None):
# check command line arguments
if argv is None:
argv = sys.argv
# check command line arguments
if argv is None:
argv = sys.argv
+
+ if len(argv) == 2 and (argv[1] == "-v" or argv[1] == "--version"):
+ print "Version: %VERSION%"
+ return 0
+
if len(argv) != 2 and len(argv) != 4:
print "Usage: " + argv[0] + " <target mhx-file> [-d DEVICE]"
return 1
if len(argv) != 2 and len(argv) != 4:
print "Usage: " + argv[0] + " <target mhx-file> [-d DEVICE]"
return 1