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

Ramalama debug option shows traceback when no subcommand is passed. #514

Open
pghole opened this issue Dec 17, 2024 · 3 comments
Open

Ramalama debug option shows traceback when no subcommand is passed. #514

pghole opened this issue Dec 17, 2024 · 3 comments

Comments

@pghole
Copy link

pghole commented Dec 17, 2024

I ran the following command and got the below response. I think it should just print till requires a subcommand and not the traceback, as it looks like the tool has crashed. Perhaps the intention is to show the traceback as it's in debug mode but this looks a confusing to users. Thoughts ?

pghole@pghole-thinkpadt14sgen2i:~/opensource_contribution/ramalama$ ramalama --debug
usage: ramalama [-h] [--container] [--debug] [--dryrun] [--engine ENGINE] [--image IMAGE] [--nocontainer] [--gpu] [--runtime {llama.cpp,vllm}] [--store STORE] [-v]
                {help,convert,containers,ps,info,list,ls,login,logout,pull,push,rm,run,serve,stop,version} ...
ramalama: requires a subcommand
Traceback (most recent call last):
  File "/usr/local/bin/ramalama", line 4, in <module>
    __import__('pkg_resources').run_script('ramalama==0.3.0', 'ramalama')
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 720, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 1559, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python3.12/site-packages/ramalama-0.3.0-py3.12.egg/EGG-INFO/scripts/ramalama", line 95, in <module>
    main(sys.argv[1:])
  File "/usr/local/lib/python3.12/site-packages/ramalama-0.3.0-py3.12.egg/EGG-INFO/scripts/ramalama", line 72, in main
    args.func(args)
    ^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'func'

@ericcurtin
Copy link
Collaborator

Best we should do here is make the error more clear.

ramalama --debug

is like running:

podman --debug

it doesn't really make much sense, but we should at least print the usage help in this case.

@pghole
Copy link
Author

pghole commented Dec 17, 2024

@ericcurtin Can I send a PR for this ? Should we print the entire help menu like podman or just printing ramalama: requires a subcommand should be fine (ramalama other commands are just printing this line) ?

@ericcurtin
Copy link
Collaborator

Of course you can @pghole 😄

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

No branches or pull requests

2 participants