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

modified command line options

parent affcff37
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ do stuff with Tomboy files ...@@ -14,7 +14,7 @@ do stuff with Tomboy files
=head1 OPTIONS =head1 OPTIONS
... -e ... edit note (used with find)
=head1 OP-CODES =head1 OP-CODES
...@@ -22,6 +22,10 @@ do stuff with Tomboy files ...@@ -22,6 +22,10 @@ do stuff with Tomboy files
Refresh table of contents file. Refresh table of contents file.
=head2 find <pattern>
Find notes matching given pattern. If option -e is given, open these notes.
=head2 show =head2 show
=head2 diff =head2 diff
...@@ -49,16 +53,30 @@ my @PAR; ...@@ -49,16 +53,30 @@ my @PAR;
while (my $arg= shift (@ARGV)) while (my $arg= shift (@ARGV))
{ {
if ($arg =~ /^-/) if ($arg eq '--')
{
push (@PAR, @ARGV);
@ARGV= ();
}
elsif ($arg =~ /^--(.+)/)
{
my ($op, $val)= split ('=', $1);
print "op=[$op] val=[$val]\n";
}
elsif ($arg =~ /^-(.+)/)
{
my @a= split ('', $1);
foreach my $a (@a)
{ {
if ($arg eq '-d') { $note_dir= shift (@ARGV); } if ($a eq 'd') { $note_dir= shift (@ARGV); }
elsif ($arg eq '-t') { $toc_file= shift (@ARGV); } elsif ($a eq 't') { $toc_file= shift (@ARGV); }
elsif ($arg eq '-e') { $start_tb= 1; } elsif ($a eq 'e') { $start_tb= 1; }
else else
{ {
usage(); usage();
} }
} }
}
else else
{ {
push (@PAR, $arg); push (@PAR, $arg);
...@@ -66,6 +84,7 @@ while (my $arg= shift (@ARGV)) ...@@ -66,6 +84,7 @@ while (my $arg= shift (@ARGV))
} }
my $op_code= shift (@PAR) unless (defined ($op_code)); my $op_code= shift (@PAR) unless (defined ($op_code));
print "op_code=[$op_code] par=[", join (';', @PAR), "]\n";
if ($op_code eq 'help') { usage(); } if ($op_code eq 'help') { usage(); }
elsif ($op_code eq 'dump') { dump_note ($_) foreach (@PAR); } elsif ($op_code eq 'dump') { dump_note ($_) foreach (@PAR); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment