Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"mock --help" outputs "Usage: 4 [options]" instead of "Usage: mock [options]" #738

Closed
scfc opened this issue Jun 7, 2021 · 4 comments
Closed

Comments

@scfc
Copy link

scfc commented Jun 7, 2021

On Fedora 33 and 34, mock --help outputs:

[root@666197b30641 /]# mock --help | head -5
Usage: 4 [options]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
[root@666197b30641 /]#

The first line should probably be Usage: mock [options].

@xsuchy
Copy link
Member

xsuchy commented Jun 8, 2021

This stems from optparse. Which we still use. It is depracated. We should rewrite our code to use argparse.

@praiskup
Copy link
Member

praiskup commented Jun 8, 2021

Agreed, I already started working on this .. but it is not a 2-minute thing as I thought :-( so I'll try to take a look later today.

praiskup added a commit to praiskup/mock that referenced this issue Jun 8, 2021
The __doc__ variable points to the first expression in the file,
believing that it is a string statement (but it was not before).

Fixes: rpm-software-management#738
praiskup added a commit to praiskup/mock that referenced this issue Jun 8, 2021
The __doc__ variable points to the first expression in the file,
believing that it is a string statement (but it was not before).

Fixes: rpm-software-management#738
@praiskup
Copy link
Member

praiskup commented Jun 8, 2021

Eventually no, the problem was with the __doc__ variable in the OptionParser(usage=__doc__, version=__VERSION__) call.
But I still think we should move to argparse (but let's leave this for the next release).

praiskup added a commit to praiskup/mock that referenced this issue Jun 8, 2021
The __doc__ variable points to the first expression in the file,
believing that it is a string statement (but it was not before).

Also the "Usage" string was duplicated in --help ouptut, so drop one of
the occurences from the __doc__ string.

Fixes: rpm-software-management#738
@praiskup
Copy link
Member

praiskup commented Jun 9, 2021

Oh, well, see also this report against usermode 1.114 https://bugzilla.redhat.com/show_bug.cgi?id=1969918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants