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

Problem to parse options with captial letters with Irssi::command_parse_options #651

Closed
varazir opened this Issue Feb 15, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@varazir

varazir commented Feb 15, 2017

Hello,

I have this code in my script

command_set_options('join_msg' => '+title +deviceId +deviceIds +deviceNames +url clipboard +smsnumber smstext +priority noencrypt +tasker text debug');

my ($join_args, $join_rest) = Irssi::command_parse_options('join_msg', $data);

ref $join_args or return 0

It doesn't return a error if the options has a uppercase like above.
If I change the options to lowercase I get a error if the +options are missing a argument

IRSSI: Client: irssi 1.0.1 (20170203 2046)

data dump
https://gist.github.com/varazir/03ac68bba36c197def700cbb66116fcc

@LemonBoy

This comment has been minimized.

Member

LemonBoy commented Feb 15, 2017

I'm still not sure about what the problem is here, can you show how you're invoking join_msg and also what you're seeing and what you expect it to show?

@varazir

This comment has been minimized.

varazir commented Feb 15, 2017

Close this, it's working as it should now. Don't ask me why. did the same test as before and now it's working

I get
Missing required argument for: deviceNames
when running this:
/join_msg -deviceNames -text

@LemonBoy

This comment has been minimized.

Member

LemonBoy commented Feb 15, 2017

Perhaps you're hitting the problem #652 solves where /join_msg -deviceNames -text shows a warning about the missing argument but /join_msg -text -deviceNames doesn't (and deviceNames is set to '') in the hash.

@LemonBoy LemonBoy closed this Feb 15, 2017

@varazir

This comment has been minimized.

varazir commented Feb 18, 2017

I build a workaround in my script. checking that the argument isn't 0 length

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