Skip to content
Snippets Groups Projects
Commit deddc8bd authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

allow passing of parameter to start_tb(), e.g. the path of the notes directory

parent 48599497
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl
=head1 NAME
......@@ -25,6 +26,8 @@ use strict;
use UUID;
use POSIX;
my %options_passed= map { $_ => 1 } qw(--note-path); # used by start_tb() function
sub link
{
my $s= shift;
......@@ -62,18 +65,29 @@ sub get_uuid
sub start_tb
{
my $what= shift;
my $par= shift;
my %par= @_;
if ($what eq 'uuid')
my @cmd= ('tomboy');
foreach my $what (keys %par)
{
my @cmd= ('tomboy', '--open-note', 'note://tomboy/'. $par);
print ">>> ", join (' ', @cmd), "\n";
my $pid= fork();
if ($pid == 0) { exec @cmd; }
print "started pid=[$pid]\n";
my $par= $par{$what};
if ($what eq 'uuid')
{
push (@cmd, '--open-note', 'note://tomboy/'. $par);
}
elsif (exists ($options_passed{$what}))
{
push (@cmd, $what, $par);
}
}
print ">>> ", join (' ', @cmd), "\n";
my $pid= fork();
if ($pid == 0) { exec @cmd; }
print "started pid=[$pid]\n";
$pid;
}
1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment