Opened 10 years ago

Closed 10 years ago

#3075 closed defect (fixed)

omc +help=debug doesn't work

Reported by: Francesco Casella Owned by: Per Östlund
Priority: blocker Milestone: 1.9.2
Component: *unknown* Version: trunk
Keywords: Cc: Adrian Pop

Description

I tried to run omc +help=debug using OMC the r24023 nightly build under Windows. The reply is

I'm sorry, I don't know what debug is

This reminds me of the old joke: type make love at the Unix prompt, it will reply: Dont' know how to make love. Stop.

In this case, though, OMC is supposed to actually know what debug is, isn't it?

Change History (18)

comment:1 by Per Östlund, 10 years ago

Cc: Adrian Pop added

This works fine on Linux at least. Adrian, can you check on Windows? Maybe System.getTerminalWidth fails on Win? Francesco, do you get the normal output with all the flags if you just run omc without any arguments?

in reply to:  1 ; comment:2 by Francesco Casella, 10 years ago

Replying to perost:

Francesco, do you get the normal output with all the flags if you just run omc without any arguments?

Yes. Also, omc +help works fine, as well as omc +help=optmodules and all other topics, except debug.

in reply to:  2 comment:3 by Per Östlund, 10 years ago

Replying to casella:

Replying to perost:

Francesco, do you get the normal output with all the flags if you just run omc without any arguments?

Yes. Also, omc +help works fine, as well as omc +help=optmodules and all other topics, except debug.

Ok, it's not getTerminalWidth that's the issue then.

comment:4 by Francesco Casella, 10 years ago

The situation is actually much worse, when using Windows (apparently everything's OK in Linux)

  • I understand that the bootstrapped compiler expects flags given with - or --, not with + However, if you type omc, the help text still refers to +help=debug and +help=topics. Please correct that
  • omc -h works as expected. However, omc -h=topics doesn't, while omc --help=topics does
  • omc +help=debug, omc -h=debug, omc --help=debug all fail for various reasons.

Please make sure this is fixed before 1.9.2 is released.

in reply to:  4 comment:5 by Per Östlund, 10 years ago

Replying to casella:

The situation is actually much worse, when using Windows (apparently everything's OK in Linux)

  • I understand that the bootstrapped compiler expects flags given with - or --, not with + However, if you type omc, the help text still refers to +help=debug and +help=topics. Please correct that

Fixed in r24111. + still works for flags, but we prefer to use - or -- now that the RML runtime no longer eats those flags.

  • omc -h works as expected. However, omc -h=topics doesn't, while omc --help=topics does

Also fixed in r24111.

  • omc +help=debug, omc -h=debug, omc --help=debug all fail for various reasons.

Probably not fixed in r24111, but let me know if my changes somehow fixed the issue.

comment:6 by Adrian Pop, 10 years ago

With r24120 on Windows (Msys terminal) I get:

adrpo@ida-liu050 ~/dev/OpenModelica/build/bin/
$ ./omc -h=debug 
I'm sorry, I don't know what debug is.
adrpo@ida-liu050 ~/dev/OpenModelica/build/bin/
$ ./omc +help=debug
I'm sorry, I don't know what debug is.

Note that:

./omc +help=topics
./omc +help=omc
./omc +help=optmodules
./omc +help=simulation

works fine.
I wonder if somehow +help=debug doesn't conflict with:

./omc +locale=C +help=topics
...
<flagname>   Displays option descriptions for multi-option flag <flagname>.
...

I'll check more.

comment:7 by Adrian Pop, 10 years ago

I think that Util.stringWrap somehow fails if the inWrapLength is 80 as returned by System.getTerminalWidth when printing debug flags.

in reply to:  7 comment:8 by Per Östlund, 10 years ago

Owner: changed from somebody to Per Östlund
Status: newaccepted

Replying to adrpo:

I think that Util.stringWrap somehow fails if the inWrapLength is 80 as returned by System.getTerminalWidth when printing debug flags.

Yes, I get the same issue now if I resize my terminal to be 79 characters in width. I'll fix it tomorrow.

comment:9 by Per Östlund, 10 years ago

Resolution: fixed
Status: acceptedclosed

The issue should now be fixed in r24126. The description for the useMPI debug flag ended with a space for some reason, and Util.stringWrap didn't handle the case when the only remainder from a split was a single space.

comment:10 by Francesco Casella, 10 years ago

I am sorry, but r24187 still doesn't work for me. If I type omc --help=debug at the cmd prompt (without resizing the window or anything), the process starts eating up memory like mad (over 2 GB after a few seconds). Eventually an error window pops up stating "Fatal error in GC: too many heap sections".

comment:11 by Francesco Casella, 10 years ago

Resolution: fixed
Status: closedreopened

comment:12 by Bernhard Bachmann, 10 years ago

omc +help=debug | more

does not give any output on Linux

in reply to:  12 ; comment:13 by Francesco Casella, 10 years ago

Replying to bachmann:

omc +help=debug | more

does not give any output on Linux

As far as I understand, +help=debug is deprecated. Does --help=debug work?

in reply to:  13 ; comment:14 by Per Östlund, 10 years ago

Replying to casella:

Replying to bachmann:

omc +help=debug | more

does not give any output on Linux

As far as I understand, +help=debug is deprecated. Does --help=debug work?

There shouldn't be any difference between +help and --help. +help=debug | more works for me in Linux though. But I will see if I can replicate the issue.

in reply to:  14 comment:15 by Willi Braun, 10 years ago

Replying to perost:

Replying to casella:

Replying to bachmann:

omc +help=debug | more

does not give any output on Linux

As far as I understand, +help=debug is deprecated. Does --help=debug work?

There shouldn't be any difference between +help and --help. +help=debug | more works for me in Linux though. But I will see if I can replicate the issue.

I can confirm the issue with redirecting +help=debug by pipe, all other cases work fine for me.

comment:16 by Per Östlund, 10 years ago

Ok, I've attempted to solve the issue in r24303. Let me know how it works for you.

comment:17 by Willi Braun, 10 years ago

Great! The reported redirecting issue is fixed for me.

comment:18 by Adrian Pop, 10 years ago

Resolution: fixed
Status: reopenedclosed

The windows issues are fixed also!

Note: See TracTickets for help on using tickets.