Skip to content

Completion script generation #101

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

Closed
edmBernard opened this issue Nov 13, 2017 · 3 comments
Closed

Completion script generation #101

edmBernard opened this issue Nov 13, 2017 · 3 comments

Comments

@edmBernard
Copy link

Since the script name getter method have been change here du to this issue #51
from name = name or sys.argv[0] to name = name or os.path.basename(sys.argv[0])
The completion script don't work anymore on linux: ./myscript.py is replaced by myscript.py

@may55
Copy link

may55 commented Jan 28, 2018

I am new to open source, can I get some help to fix this issue?

@dbieber
Copy link
Collaborator

dbieber commented Jan 28, 2018

When you generate a completion script, the last line of the script is something like
complete -F _complete-examplepy example.py

If the command you're using to run the script is just example, then you can change that final line to complete -F _complete-examplepy example and completion should resume working for you.
If you want this to be the case automatically in the generated completion scripts, you can set name='example' in your call to Fire.
If you think we can handle the default case better where no name is provided better, I'm open to ideas.

@edmBernard
Copy link
Author

I don't find better idea to just add the executable name in fire arguments for linux it will be :

fire.Fire(name='./cipher.py')

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

3 participants