Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

extensions using $precommand do not work as expected #135

Open
gustafe opened this issue Nov 24, 2017 · 0 comments
Open

extensions using $precommand do not work as expected #135

gustafe opened this issue Nov 24, 2017 · 0 comments

Comments

@gustafe
Copy link

gustafe commented Nov 24, 2017

Based on a question in issue #134, I'm not seeing the behavior that according to https://github.com/classilla should be there. I'm filing a bug in the hope of either a fix or a clarification...

Issue

Attempting to "alias" an existing command using the $precommand scalar in an extension does not work as documented (http://www.floodgap.com/software/ttytter/adv.html)

Repro

Create an extension called "mywebcmd", intended to add the /link command to get a link to a tweet.

$precommand = sub {
my $k = shift;
$k =~ s#^/link\s+#/web#;
return $k;
};

I loaded this extension only, no other extensions or options, and tried it out on a tweet:

b0> <@niklasorrenius> Och här en länk till @DanielOhman s fina avslöjande från i våras om hur Turkiets spionage, hot och angiveri i Sverige kan gå till http://sverigesradio.se/sida/artikel.aspx?programid=83&artikel=6661130
oysttyer> /web b0 <007
(echo 'https://twitter.com/niklasorrenius/statuses/934011568584581120')
https://twitter.com/niklasorrenius/statuses/934011568584581120
oysttyer> /link b0 <008
*** invalid command
*** to pass as a tweet, type /%%
oysttyer> <000

Expected behavior

The /link command as defined in the extension should give the same output as the /web command.

Version

oysttyer> /vcheck <007
-- checking Term::ReadLine::TTYtter version: http://www.floodgap.com/software/ttytter/01readlin.txt
-- checking oysttyer version: https://raw.githubusercontent.com/oysttyer/oysttyer/master/version_check.txt
-- your version of Term::ReadLine::TTYtter is up to date (1.4)
-- your version of oysttyer is up to date (2.9.1)

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

No branches or pull requests

1 participant