roelj / inklingreader

A GNU/Linux-friendly version of the Wacom Inkling SketchManager.
GNU General Public License v3.0
50 stars 16 forks source link

only svg output right now? and a gui bug #2

Closed MeraX closed 10 years ago

MeraX commented 10 years ago

After solving the compiler problems, I played around with InklingReader and found two bugs:

$ ./InklingReader -f ../SKETCH5.WPI -t ../s5.svg
$ ./InklingReader -f ../SKETCH5.WPI -t ../s5.png
$ ./InklingReader -f ../SKETCH5.WPI -t ../s5.pdf

These commands always create a svg file regardless of the given extension.

When opening SKETCH5.WPI with the gui it looks like: gui-bug which is actually not what I draw. When I export this via the gui different file formats work, but they also only show these bars. And during the loading of the dialog window for opening and closing InklingReader uses a lot of my CPU.

Never the less converting wpi to svg on the command line works very well and I'm very happy.

roelj commented 10 years ago

Thank you for your report once again. Yes, the command-line can only export to SVG at the moment. Unfortunately I think when I make the modifications to allow other formats it will only draw these bars as well.

I've seen the buggy GUI behavior on a Windows build as well. I'm actually clueless at what this could be at the moment. Are you interested in testing future versions to try to solve this?

MeraX commented 10 years ago

I prefer converting the wpi files to svg and then post process them with other tools. Like editing them with inkscape oder converting them with imagemagics convert to other formats. If you do updates every now and than, I could test the gui, but I'm more interested in the CLI.

I'm just thinking, weather it would be possible also to export the pressure. But i think svg doen't support something like stroke width right now.

roelj commented 10 years ago

Ok. Fortunately that works :)

I've been thinking about stroke pressure as well. I can extract the stroke pressure from the WPI file, but I'm not sure how to convert that to something in SVG.

How it works now is:

<start of stroke> <move to point (x1,y1)> <draw a line to point (x2,y2)> <draw a line to point (x3, y3> ...

I guess to make it possible to handle stroke pressure, I would need to draw an outline and fill that (but I don't know how to do it).

Either way, I'm a step closer to solving the GUI bug: I found out that the problem is in the combination between Rsvg and Cairo.

roelj commented 10 years ago

Could you try the GUI with the latest code in 'master'?

EDIT: I added the ability to export to other formats from the command-line as well.

MeraX commented 10 years ago

The Gui works. The open and export dialog is faster and the displayed picture is correct. export to png works, but in pdf it cuts off something on the right hand side.

But the CLI converting doesn't work anymore:

$ ./InklingReader -f ../SKETCH19.WPI -t ../19_exp.pdf
(process:13470): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.32.4/./gobject/gtype.c:2722: You forgot to call g_type_init()
(process:13470): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

^C
$ ./InklingReader -f ../SKETCH19.WPI -t ../19_exp.png
(process:13477): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.32.4/./gobject/gtype.c:2722: You forgot to call g_type_init()
(process:13477): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed
^C
$ ./InklingReader -f ../SKETCH19.WPI -t ../19_exp.svg
*** glibc detected *** ./InklingReader: munmap_chunk(): invalid pointer: 0x0000000001277940 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f245cabdb96]
./InklingReader[0x403519]
./InklingReader[0x403763]
./InklingReader[0x402449]
./InklingReader[0x402131]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f245ca6076d]
./InklingReader[0x4021a9]
======= Memory map: ========
00400000-00405000 r-xp 00000000 fc:04 37488941                           /path_to/inklingreader/InklingReader
00604000-00605000 r--p 00004000 fc:04 37488941                           /path_to/inklingreader/InklingReader
00605000-00606000 rw-p 00005000 fc:04 37488941                           /path_to/inklingreader/InklingReader
01240000-0150d000 rw-p 00000000 00:00 0                                  [heap]
7f2457136000-7f245714b000 r-xp 00000000 fc:01 1703980                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f245714b000-7f245734a000 ---p 00015000 fc:01 1703980                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f245734a000-7f245734b000 r--p 00014000 fc:01 1703980                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f245734b000-7f245734c000 rw-p 00015000 fc:01 1703980                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f245734c000-7f2457438000 rw-p 00000000 00:00 0 
7f2457438000-7f2457879000 r--p 00000000 fc:01 530018                     /usr/lib/locale/locale-archive
7f2457879000-7f245787e000 r-xp 00000000 fc:01 535511                     /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f245787e000-7f2457a7d000 ---p 00005000 fc:01 535511                     /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2457a7d000-7f2457a7e000 r--p 00004000 fc:01 535511                     /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2457a7e000-7f2457a7f000 rw-p 00005000 fc:01 535511                     /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2457a7f000-7f2457a81000 r-xp 00000000 fc:01 535509                     /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2457a81000-7f2457c80000 ---p 00002000 fc:01 535509                     /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2457c80000-7f2457c81000 r--p 00001000 fc:01 535509                     /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2457c81000-7f2457c82000 rw-p 00002000 fc:01 535509                     /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2457c82000-7f2457c9a000 r-xp 00000000 fc:01 1746970                    /lib/x86_64-linux-gnu/libresolv-2.15.so
7f2457c9a000-7f2457e9a000 ---p 00018000 fc:01 1746970                    /lib/x86_64-linux-gnu/libresolv-2.15.so
7f2457e9a000-7f2457e9b000 r--p 00018000 fc:01 1746970                    /lib/x86_64-linux-gnu/libresolv-2.15.so
7f2457e9b000-7f2457e9c000 rw-p 00019000 fc:01 1746970                    /lib/x86_64-linux-gnu/libresolv-2.15.so
7f2457e9c000-7f2457e9e000 rw-p 00000000 00:00 0 
7f2457e9e000-7f2457ebb000 r-xp 00000000 fc:01 1703999                    /lib/x86_64-linux-gnu/libselinux.so.1
7f2457ebb000-7f24580ba000 ---p 0001d000 fc:01 1703999                    /lib/x86_64-linux-gnu/libselinux.so.1
7f24580ba000-7f24580bb000 r--p 0001c000 fc:01 1703999                    /lib/x86_64-linux-gnu/libselinux.so.1
7f24580bb000-7f24580bc000 rw-p 0001d000 fc:01 1703999                    /lib/x86_64-linux-gnu/libselinux.so.1
7f24580bc000-7f24580bd000 rw-p 00000000 00:00 0 
7f24580bd000-7f24580e4000 r-xp 00000000 fc:01 1718767                    /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7f24580e4000-7f24582e4000 ---p 00027000 fc:01 1718767                    /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7f24582e4000-7f24582e6000 r--p 00027000 fc:01 1718767                    /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7f24582e6000-7f24582e7000 rw-p 00029000 fc:01 1718767                    /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7f24582e7000-7f24582e9000 r-xp 00000000 fc:01 1746980                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f24582e9000-7f24584e9000 ---p 00002000 fc:01 1746980                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f24584e9000-7f24584ea000 r--p 00002000 fc:01 1746980                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f24584ea000-7f24584eb000 rw-p 00003000 fc:01 1746980                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f24584eb000-7f2458501000 r-xp 00000000 fc:01 1704164                    /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f2458501000-7f2458700000 ---p 00016000 fc:01 1704164                    /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f2458700000-7f2458701000 r--p 00015000 fc:01 1704164                    /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f2458701000-7f2458702000 rw-p 00016000 fc:01 1704164                    /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f2458702000-7f245870b000 r-xp 00000000 fc:01 535025                     /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f245870b000-7f245890a000 ---p 00009000 fc:01 535025                     /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f245890a000-7f245890b000 r--p 00008000 fc:01 535025                     /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f245890b000-7f245890c000 rw-p 00009000 fc:01 535025                     /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f245890c000-7f2458929000 r-xp 00000000 fc:01 526317                     /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f2458929000-7f2458b28000 ---p 0001d000 fc:01 526317                     /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f2458b28000-7f2458b29000 r--p 0001c000 fc:01 526317                     /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f2458b29000-7f2458b2a000 rw-p 0001d000 fc:01 526317                     /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f2458b2a000-7f2458b32000 r-xp 00000000 fc:01 529075                     /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0
7f2458b32000-7f2458d32000 ---p 00008000 fc:01 529075                     /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0
7f2458d32000-7f2458d33000 r--p 00008000 fc:01 529075                     /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0
7f2458d33000-7f2458d34000 rw-p 00009000 fc:01 529075                     /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0
7f2458d34000-7f2458d36000 r-xp 00000000 fc:01 529432                     /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
7f2458d36000-7f2458f35000 ---p 00002000 fc:01 529432                     /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
7f2458f35000-7f2458f36000 r--p 00001000 fc:01 529432                     /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
7f2458f36000-7f2458f37000 rw-p 00002000 fc:01 529432                     /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
7f2458f37000-7f2458f5d000 r-xp 00000000 fc:01 1703996                    /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f2458f5d000-7f245915d000 ---p 00026000 fc:01 1703996                    /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f245915d000-7f245915e000 r--p 00026000 fc:01 1703996                    /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f245915e000-7f245915f000 rw-p 00027000 fc:01 1703996                    /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f245915f000-7f24591f5000 r-xp 00000000 fc:01 537198                     /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f24591f5000-7f24593f4000 ---p 00096000 fc:01 537198                     /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f24593f4000-7f24593fa000 r--p 00095000 fc:01 537198                     /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f24593fa000-7f24593fb000 rw-p 0009b000 fc:01 537198                     /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f24593fb000-7f245948b000 r-xp 00000000 fc:01 554259                     /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2
7f245948b000-7f245968a000 ---p 00090000 fc:01 554259                     /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2
7f245968a000-7f2459691000 r--p 0008f000 fc:01 554259                     /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2
7f2459691000-7f2459692000 rw-p 00096000 fc:01 554259                     /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2
7f2459692000-7f2459699000 r-xp 00000000 fc:01 1746972                    /lib/x86_64-linux-gnu/librt-2.15.so
7f2459699000-7f2459898000 ---p 00007000 fc:01 1746972                    /lib/x86_64-linux-gnu/librt-2.15.so
7f2459898000-7f2459899000 r--p 00006000 fc:01 1746972                    /lib/x86_64-linux-gnu/librt-2.15.so
7f2459899000-7f245989a000 rw-p 00007000 fc:01 1746972                    /lib/x86_64-linux-gnu/librt-2.15.so
7f245989a000-7f24598d6000 r-xp 00000000 fc:01 1704023                    /lib/x86_64-linux-gnu/libpcre.so.3.12.1
7f24598d6000-7f2459ad5000 ---p 0003c000 fc:01 1704023                    /lib/x86_64-linux-gnu/libpcre.so.3.12.1
7f2459ad5000-7f2459ad6000 r--p 0003b000 fc:01 1704023                    /lib/x86_64-linux-gnu/libpcre.so.3.12.1
7f2459ad6000-7f2459ad7000 rw-p 0003c000 fc:01 1704023                    /lib/x86_64-linux-gnu/libpcre.so.3.12.1
7f2459ad7000-7f2459ade000 r-xp 00000000 fc:01 525733                     /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
7f2459ade000-7f2459cdd000 ---p 00007000 fc:01 525733                     /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
7f2459cdd000-7f2459cde000 r--p 00006000 fc:01 525733                     /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
7f2459cde000-7f2459cdf000 rw-p 00007000 fc:01 525733                     /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
7f2459cdf000-7f2459e30000 r-xp 00000000 fc:01 525026                     /usr/lib/x86_64-linux-gnu/libxml2.so.2.7.8
7f2459e30000-7f245a030000 ---p 00151000 fc:01 525026                     /usr/lib/x86_64-linux-gnu/libxml2.so.2.7.8
7f245a030000-7f245a038000 r--p 00151000 fc:01 525026                     /usr/lib/x86_64-linux-gnu/libxml2.so.2.7.8
7f245a038000-7f245a03a000 rw-p 00159000 fc:01 525026                     /usr/lib/x86_64-linux-gnu/libxml2.so.2.7.8
7f245a03a000-7f245a03b000 rw-p 00000000 00:00 0 
7f245a03b000-7f245a072000 r-xp 00000000 fc:01 528417                     /usr/lib/x86_64-linux-gnu/libcroco-0.6.so.3.0.1
7f245a072000-7f245a271000 ---p 00037000 fc:01 528417                     /usr/lib/x86_64-linux-gnu/libcroco-0.6.so.3.0.1
7f245a271000-7f245a274000 r--p 00036000 fc:01 528417                     /usr/lib/x86_64-linux-gnu/libcroco-0.6.so.3.0.1
7f245a274000-7f245a275000 rw-p 00039000 fc:01 528417                     /usr/lib/x86_64-linux-gnu/libcroco-0.6.so.3.0.1
7f245a275000-7f245a277000 r-xp 00000000 fc:01 537357                     /usr/lib/x86_64-linux-gnu/libXdamage.so.1.1.0
7f245a277000-7f245a476000 ---p 00002000 fc:01 537357                     /usr/lib/x86_64-linux-gnu/libXdamage.so.1.1.0
7f245a476000-7f245a477000 r--p 00001000 fc:01 537357                     /usr/lib/x86_64-linux-gnu/libXdamage.so.1.1.0
7f245a477000-7f245a478000 rw-p 00002000 fc:01 537357                     /usr/lib/x86_64-linux-gnu/libXdamage.so.1.1.0
7f245a478000-7f245a47a000 r-xp 00000000 fc:01 537440                     /usr/lib/x86_64-linux-gnu/libXcomposite.so.1.0.0
7f245a47a000-7f245a679000 ---p 00002000 fc:01 537440                     /usr/lib/x86_64-linux-gnu/libXcomposite.so.1.0.0
7f245a679000-7f245a67a000 r--p 00001000 fc:01 537440                     /usr/lib/x86_64-linux-gnu/libXcomposite.so.1.0.0
7f245a67a000-7f245a67b000 rw-p 00002000 fc:01 537440                     /usr/lib/x86_64-linux-gnu/libXcomposite.so.1.0.0
7f245a67b000-7f245a684000 r-xp 00000000 fc:01 554241                     /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f245a684000-7f245a883000 ---p 00009000 fc:01 554241                     /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f245a883000-7f245a884000 r--p 00008000 fc:01 554241                     /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f245a884000-7f245a885000 rw-p 00009000 fc:01 554241                     /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f245a885000-7f245a88c000 r-xp 00000000 fc:01 528000                     /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f245a88c000-7f245aa8b000 ---p 00007000 fc:01 528000                     /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f245aa8b000-7f245aa8c000 r--p 00006000 fc:01 528000                     /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f245aa8c000-7f245aa8d000 rw-p 00007000 fc:01 528000                     /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f245aa8d000-7f245aa8f000 r-xp 00000000 fc:01 554287                     /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7f245aa8f000-7f245ac8e000 ---p 00002000 fc:01 554287                     /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7f245ac8e000-7f245ac8f000 r--p 00001000 fc:01 554287                     /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7f245ac8f000-7f245ac90000 rw-p 00002000 fc:01 554287                     /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7f245ac90000-7f245aca0000 r-xp 00000000 fc:01 554224                     /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f245aca0000-7f245ae9f000 ---p 00010000 fc:01 554224                     /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f245ae9f000-7f245aea0000 r--p 0000f000 fc:01 554224                     /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f245aea0000-7f245aea1000 rw-p 00010000 fc:01 554224                     /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f245aea1000-7f245afe9000 r-xp 00000000 fc:01 553895                     /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.4
7f245afe9000-7f245b1e8000 ---p 00148000 fc:01 553895                     /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.4
7f245b1e8000-7f245b1ec000 r--p 00147000 fc:01 553895                     /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.4
7f245b1ec000-7f245b1ee000 rw-p 0014b000 fc:01 553895                     /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.4
7f245b1ee000-7f245b1f0000 rw-p 00000000 00:00 0 
7f245b1f0000-7f245b224000 r-xp 00000000 fc:01 526431                     /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7f245b224000-7f245b424000 ---p 00034000 fc:01 526431                     /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7f245b424000-7f245b425000 r--p 00034000 fc:01 526431                     /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7f245b425000-7f245b426000 rw-p 00035000 fc:01 526431                     /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7f245b426000-7f245b46c000 r-xp 00000000 fc:01 543645                     /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0.3000.0
7f245b46c000-7f245b66c000 ---p 00046000 fc:01 543645                     /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0.3000.0
7f245b66c000-7f245b66e000 r--p 00046000 fc:01 543645                     /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0.3000.0
7f245b66e000-7f245b66f000 rw-p 00048000 fc:01 543645                     /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0.3000.0
7f245b66f000-7f245b698000 r-xp 00000000 fc:01 543644                     /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.3000.0
7f245b698000-7f245b897000 ---p 00029000 fc:01 543644                     /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.3000.0
7f245b897000-7f245b898000 r--p 00028000 fc:01 543644                     /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.3000.0
7f245b898000-7f245b899000 rw-p 00029000 fc:01 543644                     /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.3000.0
7f245b899000-7f245b8b7000 r-xp 00000000 fc:01 537247                     /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1
7f245b8b7000-7f245bab7000 ---p 0001e000 fc:01 537247                     /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1
7f245bab7000-7f245bab8000 r--p 0001e000 fc:01 537247                     /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1Abgebrochen (Speicherabzug geschrieben)

It is probably just a small bug anywhere.

roelj commented 10 years ago

I can confirm the issues on Ubuntu. I'm working on a fix.

roelj commented 10 years ago

The current 'master' should fix all the above problems. I tested and verified this on Ubuntu 12.04.

MeraX commented 10 years ago

yeah, now it works as supposed.

I have just one little confusion with the argument options:

$ ./InklingReader -g ../SKETCH19.WPI
# starts gui wich SKETCH19 shown
$ ./InklingReader --gui ../SKETCH19.WPI
# strats gui ignoring the file name
$ ./InklingReader -g
./InklingReader: option requires an argument -- 'g'
# doesn't start anything.

I think the gui should start even with -g and the file should also open wich --gui. Maybe you should leave out the -f argument so that the fist argument that has no - in front is the inputfile and than you can also leave out the -t, because the second argument that has no - is automatically the outputfile. If there is a -g or -gui in front of the inputfile, use gui.

roelj commented 10 years ago

Sorry for this confusion. I'm trying to keep it compatible with GNU programs. These are equivalent:

./InklingReader -g ../SKETCH19.WPI
./InklingReader --gui=../SKETCH19.WPI

(long options need a '='). They will both open the file.

Long options (--gui) are used to set a variable in the program. Not setting a value can be captured by the program as if the value for it is "true". Short options can be combined (For example: tar -zxvf) and often one of the options needs an argument (like tar's -f option).

This is the default behavior for GNU programs, which I am trying to stay compatible with.

To create the behavior you want you could also create an alias, and for leaving multiple options out, maybe a bash function that parsed the options with awk. (I can provide examples if you want).

Is it OK with you if I don't change the way arguments are processed?

MeraX commented 10 years ago

yeah, I'm fine with that.

roelj commented 10 years ago

Thanks. I'm going to close this issue since the bugs are fixed.