use the original query in the heading

master
Dylan Lloyd 2013-03-21 18:17:51 -04:00
parent 44be7e4afb
commit d3f643376c
2 changed files with 6 additions and 6 deletions

View File

@ -16,9 +16,9 @@ attribution github => ['https://github.com/koosha--', 'koosha--'],
code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/UnixPermissions.pm';
category 'computing_tools';
handle remainder => sub {
s/^\s+//;
s/\s+$//;
handle query => sub {
my $query = $_;
s/\s*(chmod|permissions?)\s*//g;
return unless /^(?:0|1|2|4)?([0-7]{3})$/;
my @modes_desc = (
@ -44,7 +44,7 @@ handle remainder => sub {
$plain_output .= 'More at https://en.wikipedia.org/wiki/Permissions#Notation_of_traditional_Unix_permissions';
$html_output .= 'More at <a href="https://en.wikipedia.org/wiki/Permissions#Notation_of_traditional_Unix_permissions">https://en.wikipedia.org/wiki/Permissions#Notation_of_traditional_Unix_permissions</a>';
return $plain_output, html => $html_output, heading => "Unix Permissions";
return $plain_output, html => $html_output, heading => "$query (Unix Permissions)";
};
1;

View File

@ -20,7 +20,7 @@ More at https://en.wikipedia.org/wiki/Permissions#Notation_of_traditional_Unix_p
html => '755 (octal)<br>rwxr-xr-x (symbolic)<br>User: Read, write and execute<br>Group: Read and execute<br>Others: Read and execute<br>More at <a href="https://en.wikipedia.org/wiki/Permissions#Notation_of_traditional_Unix_permissions">https://en.wikipedia.org/wiki/Permissions#Notation_of_traditional_Unix_permissions</a>',
heading => 'Unix Permissions'),
heading => 'chmod 755 (Unix Permissions)'),
'permission 0644' => test_zci(
'644 (octal)
@ -32,7 +32,7 @@ More at https://en.wikipedia.org/wiki/Permissions#Notation_of_traditional_Unix_p
html => '644 (octal)<br>rw-r--r-- (symbolic)<br>User: Read and write<br>Group: Read<br>Others: Read<br>More at <a href="https://en.wikipedia.org/wiki/Permissions#Notation_of_traditional_Unix_permissions">https://en.wikipedia.org/wiki/Permissions#Notation_of_traditional_Unix_permissions</a>',
heading => 'Unix Permissions')
heading => 'permission 0644 (Unix Permissions)')
);
done_testing;