mirror of
https://codeberg.org/scip/note.git
synced 2025-12-17 04:31:02 +01:00
CHANGED: Moved from @ARGV-parsing to Getopt::Long, adding options is now
much easier and I do now understand my own code ;-) ADDED: --raw, the "Raw Mode", which turns off any formatting of output.
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
==================================================================================
|
==================================================================================
|
||||||
|
|
||||||
|
1.0.4:
|
||||||
|
CHANGED: Moved from @ARGV-parsing to Getopt::Long, adding options is now
|
||||||
|
much easier and I do now understand my own code ;-)
|
||||||
|
ADDED: --raw, the "Raw Mode", which turns off any formatting of output.
|
||||||
|
|
||||||
|
==================================================================================
|
||||||
|
|
||||||
1.0.3:
|
1.0.3:
|
||||||
ADDED: "-" works also for --dump, but in the other direction. It causes
|
ADDED: "-" works also for --dump, but in the other direction. It causes
|
||||||
note to dump to standard output instead into a file.
|
note to dump to standard output instead into a file.
|
||||||
|
|||||||
15
README
15
README
@@ -1,4 +1,4 @@
|
|||||||
note 1.0.3 by Thomas Linden, 02/05/2000
|
note 1.0.4 by Thomas Linden, 12/05/2000
|
||||||
|
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
@@ -35,9 +35,11 @@ Requirements
|
|||||||
You need the following things:
|
You need the following things:
|
||||||
o perl installed (5.004x)
|
o perl installed (5.004x)
|
||||||
o The module IO::Seekable and Fcntl, which should be
|
o The module IO::Seekable and Fcntl, which should be
|
||||||
already installed with your perl distributuion.
|
already installed with your perl distributuion if
|
||||||
|
you want to use the binary database backend.
|
||||||
o DBI module and DBI::mysql if you want to use the
|
o DBI module and DBI::mysql if you want to use the
|
||||||
mysql version.
|
mysql database backend.
|
||||||
|
o Getopt::Long
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -255,6 +257,11 @@ Scripting
|
|||||||
$ export NOTE_PASSWD=secret
|
$ export NOTE_PASSWD=secret
|
||||||
If the variable is present, note will not ask you for a passphrase!
|
If the variable is present, note will not ask you for a passphrase!
|
||||||
|
|
||||||
|
Another thingy you might find useful is the -r (--raw) command-line flag. This
|
||||||
|
turns note into raw mode being silent, which means it will only print the
|
||||||
|
data without any formatting. Raw mode is available for list and display,
|
||||||
|
since it makes no sense, interactive mode doe not support raw mode.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -407,4 +414,4 @@ Author and Copyright
|
|||||||
Last changed
|
Last changed
|
||||||
============
|
============
|
||||||
|
|
||||||
02/05/2000
|
12/05/2000
|
||||||
|
|||||||
279
bin/note
279
bin/note
@@ -1,7 +1,14 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
# $Author: thomas $ $Id: note,v 1.22 2000/05/01 18:51:40 thomas Exp thomas $ $Revision: 1.22 $
|
# $Author: thomas $ $Id: note,v 1.24 2000/05/10 22:59:44 thomas Exp thomas $ $Revision: 1.24 $
|
||||||
#
|
#
|
||||||
# $Log: note,v $
|
# $Log: note,v $
|
||||||
|
# Revision 1.24 2000/05/10 22:59:44 thomas
|
||||||
|
# updated usage to reflect --raw and build it into output
|
||||||
|
# and display subs.
|
||||||
|
#
|
||||||
|
# Revision 1.23 2000/05/10 22:19:04 thomas
|
||||||
|
# changed to Getopt::Long, added --raw
|
||||||
|
#
|
||||||
# Revision 1.22 2000/05/01 18:51:40 thomas
|
# Revision 1.22 2000/05/01 18:51:40 thomas
|
||||||
# added "-" to sub dump
|
# added "-" to sub dump
|
||||||
#
|
#
|
||||||
@@ -68,7 +75,7 @@
|
|||||||
# *** empty log message ***
|
# *** empty log message ***
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# this is the small console program "note" (MYSQL version)
|
# this is the small console program "note"
|
||||||
# It works similar to some well known GUI note programs,
|
# It works similar to some well known GUI note programs,
|
||||||
# but instead of using X11 it uses the UN*X console.
|
# but instead of using X11 it uses the UN*X console.
|
||||||
# You can edit existing notes, delete them, create new
|
# You can edit existing notes, delete them, create new
|
||||||
@@ -86,7 +93,8 @@
|
|||||||
# note is GPL software.
|
# note is GPL software.
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Data::Dumper;
|
#use Data::Dumper;
|
||||||
|
use Getopt::Long;
|
||||||
|
|
||||||
sub usage;
|
sub usage;
|
||||||
sub find_editor;
|
sub find_editor;
|
||||||
@@ -116,10 +124,13 @@ my (
|
|||||||
$BORDERC, $BORDER_COLOR, $_BORDERC, $NOTEC, $NOTE_COLOR,
|
$BORDERC, $BORDER_COLOR, $_BORDERC, $NOTEC, $NOTE_COLOR,
|
||||||
$NUMC, $NUM_COLOR, $_NUMC, $_NOTEC, $TIMEC, $TIME_COLOR,
|
$NUMC, $NUM_COLOR, $_NUMC, $_NOTEC, $TIMEC, $TIME_COLOR,
|
||||||
$_TIMEC, $TOPICC, $TOPIC_COLOR, $_TOPICC, $SetTitle, $COLOR,
|
$_TIMEC, $TOPICC, $TOPIC_COLOR, $_TOPICC, $SetTitle, $COLOR,
|
||||||
$typedef, $MAX_NOTE, $MAX_TIME, @NumBlock, $ALWAYS_EDIT, $HOME,
|
$typedef, $MAX_NOTE, $MAX_TIME, @NumBlock, $ALWAYS_EDIT, $HOME, $has_nothing,
|
||||||
$db, $dbname, $dbhost, $DEFAULTDBNAME, $dbuser, $USER, $dbpasswd,
|
$db, $dbname, $dbhost, $DEFAULTDBNAME, $dbuser, $USER, $dbpasswd,
|
||||||
$table, $fnum, $fnote, $fdate, $date, $dbdriver, $libpath, $db,
|
$table, $fnum, $fnote, $fdate, $date, $dbdriver, $libpath, $db, @ArgTopics, $Raw,
|
||||||
$USE_CRYPT, $CRYPT_METHOD, $key
|
$USE_CRYPT, $CRYPT_METHOD, $key,
|
||||||
|
$opt_, $opt_i, $opt_r, $opt_e, $opt_d, $opt_s,
|
||||||
|
$opt_t, $opt_T, $opt_l, $opt_L, $opt_D, $opt_I,
|
||||||
|
$opt_o, $opt_h, $opt_n, $opt_v
|
||||||
);
|
);
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
@@ -146,7 +157,7 @@ $TIME_COLOR = "black";
|
|||||||
$TOPIC_COLOR = "BLACK";
|
$TOPIC_COLOR = "BLACK";
|
||||||
$TOPIC = 1;
|
$TOPIC = 1;
|
||||||
$TopicSep = '/';
|
$TopicSep = '/';
|
||||||
$version = "1.0.3";
|
$version = "1.0.4";
|
||||||
if($TOPIC)
|
if($TOPIC)
|
||||||
{
|
{
|
||||||
$CurDepth = 1; # the current depth inside the topic "directory" structure...
|
$CurDepth = 1; # the current depth inside the topic "directory" structure...
|
||||||
@@ -159,162 +170,142 @@ if($ARGV[0] eq "")
|
|||||||
{
|
{
|
||||||
$mode = "new";
|
$mode = "new";
|
||||||
}
|
}
|
||||||
else
|
elsif($#ARGV == 0 && $ARGV[0] eq "-") {
|
||||||
{
|
|
||||||
while($ARGV[0] ne "" )
|
|
||||||
{
|
|
||||||
if($ARGV[0] =~ /^\d/)
|
|
||||||
{
|
|
||||||
# first arg is a digit!
|
|
||||||
$number = $ARGV[0];
|
|
||||||
if($mode eq "")
|
|
||||||
{
|
|
||||||
# change mode only, if started with an option
|
|
||||||
# ($mode will be already set)
|
|
||||||
$mode = "display";
|
|
||||||
}
|
|
||||||
$ARGV[0] = "";
|
|
||||||
}
|
|
||||||
elsif($ARGV[0] eq "-")
|
|
||||||
{
|
|
||||||
$NewType = 1;
|
|
||||||
$mode = "new";
|
$mode = "new";
|
||||||
$ARGV[0] = "";
|
$NewType = 1;
|
||||||
|
shift;
|
||||||
|
undef $has_nothing;
|
||||||
}
|
}
|
||||||
elsif($ARGV[0] eq "-i" || $ARGV[0] eq "--interactive")
|
else
|
||||||
{
|
{
|
||||||
|
Getopt::Long::Configure( qw(bundling)); # allow -lr
|
||||||
|
GetOptions (
|
||||||
|
"interactive|i!" => \$opt_i, # no arg
|
||||||
|
"raw|r!" => \$opt_r, # no arg
|
||||||
|
"edit|e=i" => \$opt_e, # integer, required
|
||||||
|
"delete|d=s" => \$opt_d, # integer, required
|
||||||
|
"search|s=s" => \$opt_s, # string, required
|
||||||
|
"tree|t!" => \$opt_t, # no arg
|
||||||
|
"long_tree|T!" => \$opt_T, # no arg
|
||||||
|
"list|l:s" => \$opt_l, # string, optional
|
||||||
|
"long_list|L:s" => \$opt_L, # string, optional
|
||||||
|
"dump|D:s" => \$opt_D, # string, optional
|
||||||
|
"import|I:s" => \$opt_I, # string, optional
|
||||||
|
"overwrite|o!" => \$opt_o, # no arg
|
||||||
|
"help|h|?!" => \$opt_h, # no arg
|
||||||
|
"version|v!" => \$opt_v # no arg
|
||||||
|
);
|
||||||
|
$opt_n = shift; # after that @ARGV contains eventually
|
||||||
|
# a note-number
|
||||||
|
# $opt_ is a single dash, in case of existence!
|
||||||
|
# determine mode
|
||||||
|
if($opt_i) {
|
||||||
$mode = "interactive";
|
$mode = "interactive";
|
||||||
$ARGV[0] = "";
|
|
||||||
}
|
}
|
||||||
elsif($ARGV[0] eq "-t" || $ARGV[0] eq "--tree")
|
elsif(defined $opt_l || defined $opt_L) {
|
||||||
{
|
|
||||||
$mode = "tree";
|
|
||||||
$ARGV[0] = "";
|
|
||||||
}
|
|
||||||
elsif($ARGV[0] eq "-T" || $ARGV[0] eq "--longtree")
|
|
||||||
{
|
|
||||||
$mode = "tree";
|
|
||||||
$TreeType = "LONG";
|
|
||||||
$ARGV[0] = "";
|
|
||||||
}
|
|
||||||
elsif($ARGV[0] eq "-l" || $ARGV[0] eq "--list")
|
|
||||||
{
|
|
||||||
$mode = "list";
|
$mode = "list";
|
||||||
my @ArgTopics = split /$TopicSep/,$ARGV[1];
|
if(defined $opt_l) {
|
||||||
$CurDepth += $#ArgTopics + 1 if $ARGV[1];
|
@ArgTopics = split /$TopicSep/, $opt_l;
|
||||||
$CurTopic = $ArgTopics[$#ArgTopics]; # use the last element everytime...
|
|
||||||
$ARGV[0] = "";
|
|
||||||
}
|
}
|
||||||
elsif($ARGV[0] eq "-L" || $ARGV[0] eq "--longlist")
|
else {
|
||||||
{
|
|
||||||
$mode = "list";
|
|
||||||
$ListType = "LONG";
|
$ListType = "LONG";
|
||||||
$CurTopic = $ARGV[1];
|
@ArgTopics = split /$TopicSep/, $opt_L;
|
||||||
$ARGV[0] = "";
|
|
||||||
}
|
}
|
||||||
elsif($ARGV[0] eq "-s" || $ARGV[0] eq "--search")
|
$CurDepth += $#ArgTopics + 1 if($opt_l || $opt_L);
|
||||||
{
|
$CurTopic = $ArgTopics[$#ArgTopics]; # use the last element everytime...
|
||||||
# searching
|
}
|
||||||
|
elsif($opt_t || $opt_T) {
|
||||||
|
$mode = "tree";
|
||||||
|
$TreeType = "LONG" if($opt_T);
|
||||||
|
}
|
||||||
|
elsif(defined $opt_s) {
|
||||||
$mode = "search";
|
$mode = "search";
|
||||||
$searchstring = $ARGV[1];
|
$searchstring = $opt_s;
|
||||||
$ARGV[0] = "";
|
|
||||||
}
|
}
|
||||||
elsif($ARGV[0] eq "-e" || $ARGV[0] eq "--edit")
|
elsif($opt_e) {
|
||||||
{
|
|
||||||
if($mode eq "edit")
|
|
||||||
{
|
|
||||||
# note -e -e !
|
|
||||||
&usage;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$mode = "edit";
|
$mode = "edit";
|
||||||
shift;
|
$number = $opt_e;
|
||||||
}
|
}
|
||||||
}
|
elsif($opt_d) {
|
||||||
elsif($ARGV[0] eq "-d" || $ARGV[0] eq "--delete")
|
|
||||||
{
|
|
||||||
if($mode eq "delete")
|
|
||||||
{
|
|
||||||
&usage;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$mode = "delete";
|
$mode = "delete";
|
||||||
shift;
|
$number = $opt_d;
|
||||||
}
|
}
|
||||||
}
|
elsif(defined $opt_D) {
|
||||||
elsif($ARGV[0] eq "-D" || $ARGV[0] eq "--Dump" || $ARGV[0] eq "--dump")
|
|
||||||
{
|
|
||||||
$mode = "dump";
|
$mode = "dump";
|
||||||
$dump_file = $ARGV[1];
|
if(!$opt_) {
|
||||||
$ARGV[0] = "";
|
if($opt_D ne "") {
|
||||||
if($dump_file eq "")
|
$dump_file = $opt_D;
|
||||||
{
|
}
|
||||||
|
else {
|
||||||
$dump_file = "note.dump.$$";
|
$dump_file = "note.dump.$$";
|
||||||
print "no dumpfile specified, using $dump_file.\n";
|
print "no dumpfile specified, using $dump_file.\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif($ARGV[0] eq "-o" || $ARGV[0] eq "--overwrite")
|
else {
|
||||||
{
|
$dump_file = "-"; # use STDIN
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elsif(defined $opt_I) {
|
||||||
$mode = "import";
|
$mode = "import";
|
||||||
$ImportType = $ARGV[0];
|
if(!$opt_) {
|
||||||
if($ARGV[1] eq "-I" || $ARGV[1] eq "--Import") {
|
if($opt_I ne "") {
|
||||||
$dump_file = $ARGV[2];
|
$dump_file = $opt_I;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "--overwrite is only suitable for use with --import!\n";
|
print "Import-error! No dump_file specified!\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
$ARGV[0] = "";
|
|
||||||
if($dump_file eq "")
|
|
||||||
{
|
|
||||||
print "No dumpfile specified.\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elsif($ARGV[0] eq "-I" || $ARGV[0] eq "--Import" || $ARGV[0] eq "--import")
|
|
||||||
{
|
|
||||||
$mode = "import";
|
|
||||||
if($ARGV[1] eq "-o" || $ARGV[1] eq "-overwrite") {
|
|
||||||
$dump_file = $ARGV[2];
|
|
||||||
$ImportType = $ARGV[1];
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$dump_file = $ARGV[1];
|
$dump_file = "-";
|
||||||
$ImportType = $ARGV[2];
|
|
||||||
}
|
|
||||||
$ARGV[0] = "";
|
|
||||||
if($dump_file eq "")
|
|
||||||
{
|
|
||||||
print "No dumpfile specified.\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif($ARGV[0] eq "-v" || $ARGV[0] eq "--version")
|
elsif($opt_v) {
|
||||||
{
|
|
||||||
print "This is note $version by Thomas Linden <tom\@daemon.de>.\n";
|
print "This is note $version by Thomas Linden <tom\@daemon.de>.\n";
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
elsif($ARGV[0] eq "-h" || $ARGV[0] eq "--help")
|
elsif($opt_h) {
|
||||||
|
&usage;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$has_nothing = 1;
|
||||||
|
}
|
||||||
|
### determine generic options
|
||||||
|
if($opt_n =~ /^[\d+\-?\,*]+$/) {
|
||||||
|
# first arg is a digit!
|
||||||
|
if($mode eq "") {
|
||||||
|
$number = $opt_n;
|
||||||
|
$mode = "display";
|
||||||
|
undef $has_nothing;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print "mode <$mode> does not take a numerical argument!\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elsif($opt_n ne "") {
|
||||||
|
print "Unknown option: $opt_n\n";
|
||||||
|
&usage;
|
||||||
|
}
|
||||||
|
if($opt_r) {
|
||||||
|
$Raw = 1;
|
||||||
|
}
|
||||||
|
if($opt_o) {
|
||||||
|
$ImportType = "overwrite";
|
||||||
|
if(!$opt_I) {
|
||||||
|
print "--overwrite is only suitable for use with --import!\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#####
|
||||||
|
}
|
||||||
|
if($has_nothing && $mode eq "")
|
||||||
{
|
{
|
||||||
&usage;
|
&usage;
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
&usage;
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# open the configfile.
|
# open the configfile.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(-e $CONF)
|
if(-e $CONF)
|
||||||
{
|
{
|
||||||
eval `cat $CONF`;
|
eval `cat $CONF`;
|
||||||
@@ -481,8 +472,13 @@ sub display
|
|||||||
($note, $date) = $db->get_single($N);
|
($note, $date) = $db->get_single($N);
|
||||||
if($note)
|
if($note)
|
||||||
{
|
{
|
||||||
|
if($Raw) {
|
||||||
|
print "$N\n$date\n$note\n\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
output($N, $note, $date, "SINGLE");
|
output($N, $note, $date, "SINGLE");
|
||||||
print "\n";
|
print "\n";
|
||||||
|
}
|
||||||
$match = 1;
|
$match = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -499,7 +495,6 @@ sub search
|
|||||||
if($searchstring eq "")
|
if($searchstring eq "")
|
||||||
{
|
{
|
||||||
&usage;
|
&usage;
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
print "searching the database $dbname for \"$searchstring\"...\n\n";
|
print "searching the database $dbname for \"$searchstring\"...\n\n";
|
||||||
|
|
||||||
@@ -524,7 +519,7 @@ sub search
|
|||||||
sub list
|
sub list
|
||||||
{
|
{
|
||||||
my(@topic,@RealTopic, $i,$t,$n,$num,@CurItem,$top,$in,%res);
|
my(@topic,@RealTopic, $i,$t,$n,$num,@CurItem,$top,$in,%res);
|
||||||
if($mode ne "interactive")
|
if($mode ne "interactive" && !$Raw)
|
||||||
{
|
{
|
||||||
print "List of all existing notes:\n\n";
|
print "List of all existing notes:\n\n";
|
||||||
}
|
}
|
||||||
@@ -1097,6 +1092,8 @@ Options:
|
|||||||
which causes note, silently to read in a dump from STDIN.
|
which causes note, silently to read in a dump from STDIN.
|
||||||
-o --overwrite only suitable for use with --Import. Overwrites an
|
-o --overwrite only suitable for use with --Import. Overwrites an
|
||||||
existing notedb.
|
existing notedb.
|
||||||
|
-r --raw raw mode, out will not be formatted. Works not in interactive
|
||||||
|
mode, only on cmd-line for list and display.
|
||||||
-i --interactive interactive mode
|
-i --interactive interactive mode
|
||||||
- if you run note only with one dash: "note -", then it will
|
- if you run note only with one dash: "note -", then it will
|
||||||
read in a new note from STDIN until EOF, this makes it
|
read in a new note from STDIN until EOF, this makes it
|
||||||
@@ -1116,6 +1113,8 @@ Options:
|
|||||||
time it runs. You can avoid this behavior by setting the environment-variable
|
time it runs. You can avoid this behavior by setting the environment-variable
|
||||||
\$NOTE_PASSWD. You will need this for example, if you call note from a script.
|
\$NOTE_PASSWD. You will need this for example, if you call note from a script.
|
||||||
~;
|
~;
|
||||||
|
#my ($package, $filename, $line) = caller;
|
||||||
|
#print "called from line $line\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
sub find_editor {
|
sub find_editor {
|
||||||
@@ -1155,6 +1154,8 @@ sub output
|
|||||||
{
|
{
|
||||||
$SP = " " x ($maxlen-2 - $PathLen);
|
$SP = " " x ($maxlen-2 - $PathLen);
|
||||||
}
|
}
|
||||||
|
if(!$Raw) {
|
||||||
|
# no title in raw-mode!
|
||||||
print C $LINE;
|
print C $LINE;
|
||||||
|
|
||||||
print C "$L $NUMC#$_NUMC ";
|
print C "$L $NUMC#$_NUMC ";
|
||||||
@@ -1176,6 +1177,7 @@ sub output
|
|||||||
}
|
}
|
||||||
|
|
||||||
print C $LINE;
|
print C $LINE;
|
||||||
|
}
|
||||||
$SetTitle = 1;
|
$SetTitle = 1;
|
||||||
}
|
}
|
||||||
$title = "";
|
$title = "";
|
||||||
@@ -1186,6 +1188,7 @@ sub output
|
|||||||
{
|
{
|
||||||
$diff = $maxlen - $len;
|
$diff = $maxlen - $len;
|
||||||
$Space = " " x $diff;
|
$Space = " " x $diff;
|
||||||
|
if(!$Raw) {
|
||||||
if($num eq "-")
|
if($num eq "-")
|
||||||
{
|
{
|
||||||
$title = $BORDERC . $TOPICC . "\"" . $note . "\"" . $_TOPICC . $Space . "$_BORDERC";
|
$title = $BORDERC . $TOPICC . "\"" . $note . "\"" . $_TOPICC . $Space . "$_BORDERC";
|
||||||
@@ -1194,13 +1197,27 @@ sub output
|
|||||||
{
|
{
|
||||||
$title = $BORDERC . $NOTEC . "\"" . $note . "\"" . $_NOTEC . $Space . "$_BORDERC";
|
$title = $BORDERC . $NOTEC . "\"" . $note . "\"" . $_NOTEC . $Space . "$_BORDERC";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$title = $note;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$title = substr($note,0,($maxlen - 2 - $nlen));
|
$title = substr($note,0,($maxlen - 2 - $nlen));
|
||||||
|
if(!$Raw) {
|
||||||
$title = $BORDERC . $NOTEC . "\"" . $title . "...\"$_NOTEC$_BORDERC";
|
$title = $BORDERC . $NOTEC . "\"" . $title . "...\"$_NOTEC$_BORDERC";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if($Raw) {
|
||||||
|
print "$num ";
|
||||||
|
print "$time " if($ListType eq "LONG");
|
||||||
|
if($title =~ /^ => (.*)$TopicSep (.*)$/) {
|
||||||
|
$title = "$1$TopicSep $2"; # seems to be a topic!
|
||||||
|
}
|
||||||
|
print "$title\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
# $title should now look as: "A sample note "
|
# $title should now look as: "A sample note "
|
||||||
print C "$L $NUMC$num$_NUMC $R";
|
print C "$L $NUMC$num$_NUMC $R";
|
||||||
if($ListType eq "LONG")
|
if($ListType eq "LONG")
|
||||||
@@ -1208,12 +1225,12 @@ sub output
|
|||||||
print C "$L$TIMEC" . $time . " $_TIMEC$R";
|
print C "$L$TIMEC" . $time . " $_TIMEC$R";
|
||||||
}
|
}
|
||||||
print C "$L $NOTEC" . $title . "$_NOTEC $R\n";
|
print C "$L $NOTEC" . $title . "$_NOTEC $R\n";
|
||||||
|
|
||||||
|
|
||||||
print C $LINE;
|
print C $LINE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
# we will not reach this in raw-mode, therefore no decision here!
|
||||||
chomp $note;
|
chomp $note;
|
||||||
$Space = " " x ($maxlen - 16);
|
$Space = " " x ($maxlen - 16);
|
||||||
$SP = " " x ($maxlen + 13);
|
$SP = " " x ($maxlen + 13);
|
||||||
|
|||||||
Reference in New Issue
Block a user