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

Add tab completion for in program commands #789

Merged
merged 3 commits into from
Mar 6, 2018

Conversation

vn-ki
Copy link
Member

@vn-ki vn-ki commented Feb 24, 2018

Closes #783.

'pls', 'mix', 'url', 'url_file', 'pl', 'rm', 'undump', 'dump',
'sw', 'shuffle', 'reverse', 'repeat', 'suser', 'splaylist']

SET_COMMANDS = ['set order', 'set user_order', 'set max_results',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to iterate over config to get this list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -24,6 +24,26 @@

XYTuple = collections.namedtuple('XYTuple', 'width height max_results')

COMMANDS = ['play', 'set', 'album', 'all', 'playurl', 'browserplay',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awkward... I don't like the redundancy, but the current regex method makes it difficult to do anything else...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's an other way to do it.

@vn-ki
Copy link
Member Author

vn-ki commented Mar 5, 2018

@ids1024 Any other changes required?

@ids1024 ids1024 merged commit 146df59 into mps-youtube:develop Mar 6, 2018
@ids1024
Copy link
Contributor

ids1024 commented Mar 6, 2018

Merged. I don't like the list of of commands, but there isn't an easy solution. The regex library can do partial matching, which could determine which patterns match, but I don't know how that could generate suggestions. And it would be an addition dependency.

I opened #801, related to this.

@doriancuentas
Copy link

doriancuentas commented Jun 5, 2019

how can I find out why tab completion not working on my configuration?

$ mpsyt --version
mpsyt version : 0.2.8
notes : released 17 February 2018
pafy version : 0.5.4 (youtube-dl backend)
youtube-dl version : 2019.05.20
Python version : 3.7.3 (default, May 13 2019, 18:48:30)
[GCC 7.4.0]
Processor : x86_64
Machine type : x86_64
Architecture : 64bit,
Platform : Linux-4.18.0-20-generic-x86_64-with-debian-buster-sid
sys.stdout.enc : UTF-8
default enc : utf-8
Config dir : /home/user/.config/mps-youtube
env:TERM : xterm-256color
env:SHELL : /bin/bash
env:LANG : en_GB.UTF-8
env:LANGUAGE : en_GB:en_US:es:zh_CN

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

Successfully merging this pull request may close these issues.

Tab completion for commands
3 participants