0

I am bundling my python app into an .AppImage file. Now, when I run it with flag -h I would expect it to print something along these lines:

$ ./mytool.AppImage -h
usage: mytool [-h] [-d DIR] [-f] [-e] [BLA [BLA ...]]
...

But due to the nature of the AppImage bundling process I get:

$ ./mytool.AppImage -h
usage: AppRun [-h] [-d DIR] [-f] [-e] [BLA [BLA ...]]
...

That is, AppRun instead of mytool.

So my question is:

How can I force override the app name so that regardless of how the app is called it will always print the same name in the usage string?

gmagno
  • 1,770
  • 1
  • 19
  • 40

1 Answers1

2

As per hpaulj's comment, this can solved by simply setting the prog parameter of the argparse.ArgumentParser constructor:

parser = argparse.ArgumentParser(
        prog='mytool',
        description='Some description...'
)
gmagno
  • 1,770
  • 1
  • 19
  • 40