mirror of
https://codeberg.org/scip/note.git
synced 2025-12-17 12:41:10 +01:00
FIXED: there were some odd bugs in commandline parsing, some options were unavailable.
FIXED: Forgot "PreferredEditor" config-option in the new config format.
FIXED: the interactive "cd .." command has ignored the presence of a
"DefaultLong" setting(and search too)... thx to Peter.
CHANGED: Optimized a little bit the output routine, now it is better to read.
ADDED: sub format and appropriate config-option for text formatting capabilities.
CHANGED: changed getconfig regexp, which allows now also to use Option = Param.
FIXED: was not possible to override config-options, which are set by default to
something.
ADDED: note chacks now, if a database os actually really encrypted and exits with
an error if it s and the user turned off encryption. This protects her from
destroying it's own database ..
This commit is contained in:
16
Changelog
16
Changelog
@@ -1,5 +1,21 @@
|
|||||||
==================================================================================
|
==================================================================================
|
||||||
|
|
||||||
|
1.0.6:
|
||||||
|
FIXED: there were some odd bugs in commandline parsing, some options were unavailable.
|
||||||
|
FIXED: Forgot "PreferredEditor" config-option in the new config format.
|
||||||
|
FIXED: the interactive "cd .." command has ignored the presence of a
|
||||||
|
"DefaultLong" setting(and search too)... thx to Peter.
|
||||||
|
CHANGED: Optimized a little bit the output routine, now it is better to read.
|
||||||
|
ADDED: sub format and appropriate config-option for text formatting capabilities.
|
||||||
|
CHANGED: changed getconfig regexp, which allows now also to use Option = Param.
|
||||||
|
FIXED: was not possible to override config-options, which are set by default to
|
||||||
|
something.
|
||||||
|
ADDED: note chacks now, if a database os actually really encrypted and exits with
|
||||||
|
an error if it s and the user turned off encryption. This protects her from
|
||||||
|
destroying it's own database ..
|
||||||
|
|
||||||
|
==================================================================================
|
||||||
|
|
||||||
1.0.5:
|
1.0.5:
|
||||||
FIXED: the T (and t respectively) printed nothing out since 1.0.3! It does
|
FIXED: the T (and t respectively) printed nothing out since 1.0.3! It does
|
||||||
it now again...
|
it now again...
|
||||||
|
|||||||
38
README
38
README
@@ -1,4 +1,4 @@
|
|||||||
note 1.0.5 by Thomas Linden, 14/05/2000
|
note 1.0.6 by Thomas Linden, 18/05/2000
|
||||||
=======================================
|
=======================================
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
@@ -292,6 +292,36 @@ Topics
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Formatting of notes
|
||||||
|
===================
|
||||||
|
|
||||||
|
Another very nice feature is the possibility to format the note-text (as much as
|
||||||
|
shell allows it). First, you can use the note-internal "magic-strings" for color-
|
||||||
|
izing. Those strings looks much like HTML:
|
||||||
|
"<green>here is a green line of text</green> no more green."
|
||||||
|
As you see, the beginning of another color starts with a tag(kinda) of the color
|
||||||
|
<colorname> and ens with an end tag </colorname>.
|
||||||
|
|
||||||
|
The following colors are available:
|
||||||
|
black, red, green, yellow, blue, magenta, cyan and white.
|
||||||
|
|
||||||
|
Beside colorizing text, you can also create bold or underlined text! If you decide
|
||||||
|
to use this (additional) feature, you need to set the Config-Option "FormatNotes"
|
||||||
|
to 1 which turns it on.
|
||||||
|
Usage is very straightforward, if a word (a word is defined as some text with at least
|
||||||
|
one space surrounded) is between a magic mark-character. Here are the available
|
||||||
|
things, you can do:
|
||||||
|
|
||||||
|
bold: **word**
|
||||||
|
underlined: __word__
|
||||||
|
inverse: {{word}}
|
||||||
|
|
||||||
|
The text will be formatted using the actually note-color.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Scripting
|
Scripting
|
||||||
=========
|
=========
|
||||||
|
|
||||||
@@ -326,8 +356,8 @@ Scripting
|
|||||||
Format of the notedb (binary backend)
|
Format of the notedb (binary backend)
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
The database where the notes are stored is a binary file of
|
The database where the notes are stored is a binary fixed record length file
|
||||||
the following format:
|
of the following format:
|
||||||
It consists of three fixed length fields per entry. The fields
|
It consists of three fixed length fields per entry. The fields
|
||||||
have the following types:
|
have the following types:
|
||||||
o Number: Integer (1 byte)
|
o Number: Integer (1 byte)
|
||||||
@@ -484,4 +514,4 @@ Contributors / Credits
|
|||||||
Last changed
|
Last changed
|
||||||
============
|
============
|
||||||
|
|
||||||
14/05/2000
|
18/05/2000
|
||||||
|
|||||||
161
bin/note
161
bin/note
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
# $Id: note,v 1.26 2000/05/13 01:05:17 thomas Exp thomas $
|
# $Id: note,v 1.27 2000/05/16 23:51:35 thomas Exp thomas $
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# note - console notes management with database and encryption support.
|
# note - console notes management with database and encryption support.
|
||||||
@@ -71,7 +71,7 @@ my (
|
|||||||
# options from config file .noterc
|
# options from config file .noterc
|
||||||
#
|
#
|
||||||
$maxlen, $timelen, $TOPIC, $NOTEDB, $MAX_TIME, $PreferredEditor,
|
$maxlen, $timelen, $TOPIC, $NOTEDB, $MAX_TIME, $PreferredEditor,
|
||||||
$ALWAYS_INT, $KEEP_TIMESTAMP, $COLOR, $ALWAYS_EDIT, $HOME,
|
$ALWAYS_INT, $KEEP_TIMESTAMP, $COLOR, $ALWAYS_EDIT, $HOME, $FormatText,
|
||||||
$BORDER_COLOR, $NOTE_COLOR, $NUM_COLOR, $TOPIC_COLOR, $MAX_NOTE,
|
$BORDER_COLOR, $NOTE_COLOR, $NUM_COLOR, $TOPIC_COLOR, $MAX_NOTE,
|
||||||
$USE_CRYPT, $CRYPT_METHOD, $TopicSep, $DEFAULT_LIST, $TIME_COLOR,
|
$USE_CRYPT, $CRYPT_METHOD, $TopicSep, $DEFAULT_LIST, $TIME_COLOR,
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ $TIME_COLOR = "black";
|
|||||||
$TOPIC_COLOR = "BLACK";
|
$TOPIC_COLOR = "BLACK";
|
||||||
$TOPIC = 1;
|
$TOPIC = 1;
|
||||||
$TopicSep = '/';
|
$TopicSep = '/';
|
||||||
$version = "1.0.5";
|
$version = "1.0.6";
|
||||||
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,11 +159,11 @@ else
|
|||||||
"delete|d=s" => \$opt_d, # integer, required
|
"delete|d=s" => \$opt_d, # integer, required
|
||||||
"search|s=s" => \$opt_s, # string, required
|
"search|s=s" => \$opt_s, # string, required
|
||||||
"tree|topic|t!" => \$opt_t, # no arg
|
"tree|topic|t!" => \$opt_t, # no arg
|
||||||
"long_tree|T!" => \$opt_T, # no arg
|
"longtopic|T!" => \$opt_T, # no arg
|
||||||
"list|l:s" => \$opt_l, # string, optional
|
"list|l:s" => \$opt_l, # string, optional
|
||||||
"long_list|L:s" => \$opt_L, # string, optional
|
"longlist|L:s" => \$opt_L, # string, optional
|
||||||
"dump|D:s" => \$opt_D, # string, optional
|
"dump||Dump|D:s" => \$opt_D, # string, optional
|
||||||
"import|I:s" => \$opt_I, # string, optional
|
"import|Import|I:s" => \$opt_I, # string, optional
|
||||||
"overwrite|o!" => \$opt_o, # no arg
|
"overwrite|o!" => \$opt_o, # no arg
|
||||||
"help|h|?!" => \$opt_h, # no arg
|
"help|h|?!" => \$opt_h, # no arg
|
||||||
"version|v!" => \$opt_v # no arg
|
"version|v!" => \$opt_v # no arg
|
||||||
@@ -349,7 +349,7 @@ $NoteKey = $TopicSep . "notes" . $TopicSep;
|
|||||||
|
|
||||||
if($ListType ne "LONG" && $mode ne "interactive")
|
if($ListType ne "LONG" && $mode ne "interactive")
|
||||||
{
|
{
|
||||||
$maxlen += $timelen; # no time will be displayed!
|
#$maxlen += $timelen; # no time will be displayed!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -381,9 +381,9 @@ if($USE_CRYPT eq "YES" && $NOTEDB::crypt_supported == 1) {
|
|||||||
$db->use_crypt($key,$CRYPT_METHOD);
|
$db->use_crypt($key,$CRYPT_METHOD);
|
||||||
undef $key;
|
undef $key;
|
||||||
# verify correctness of passwd
|
# verify correctness of passwd
|
||||||
my ($note, $date) = $db->get_single(1);
|
my ($cnote, $cdate) = $db->get_single(1);
|
||||||
if($date ne "") {
|
if($cdate ne "") {
|
||||||
if($date !~ /^\d+\.\d+?/) {
|
if($cdate !~ /^\d+\.\d+?/) {
|
||||||
print "access denied.\n"; # decrypted $date is not a number!
|
print "access denied.\n"; # decrypted $date is not a number!
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -392,6 +392,13 @@ if($USE_CRYPT eq "YES" && $NOTEDB::crypt_supported == 1) {
|
|||||||
else {
|
else {
|
||||||
$db->no_crypt;
|
$db->no_crypt;
|
||||||
# does: NOTEDB::crypt_supported = 0;
|
# does: NOTEDB::crypt_supported = 0;
|
||||||
|
my ($cnote, $cdate) = $db->get_single(1);
|
||||||
|
if($cdate ne "") {
|
||||||
|
if($cdate !~ /^\d+\.\d+?/) {
|
||||||
|
print "$NOTEDB seems to be encrypted!\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# main loop: ###############
|
# main loop: ###############
|
||||||
@@ -477,7 +484,6 @@ sub display
|
|||||||
sub search
|
sub search
|
||||||
{
|
{
|
||||||
my($n,$match,$note,$date,$num,%res);
|
my($n,$match,$note,$date,$num,%res);
|
||||||
$maxlen += $timelen;
|
|
||||||
if($searchstring eq "")
|
if($searchstring eq "")
|
||||||
{
|
{
|
||||||
print "No searchstring specified!\n";
|
print "No searchstring specified!\n";
|
||||||
@@ -507,7 +513,10 @@ 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" && !$Raw)
|
if($mode ne "interactive" && !$Raw)
|
||||||
{
|
{
|
||||||
print "List of all existing notes:\n\n";
|
print "\nList of all existing notes:\n\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
# list all available notes (number and firstline)
|
# list all available notes (number and firstline)
|
||||||
@@ -858,9 +867,8 @@ sub import
|
|||||||
|
|
||||||
sub interactive
|
sub interactive
|
||||||
{
|
{
|
||||||
my($maxlen_save, $B, $BB, $menu, $char, @LastTopic, $Channel);
|
my($B, $BB, $menu, $char, @LastTopic, $Channel);
|
||||||
$Channel = $|;
|
$Channel = $|;
|
||||||
$maxlen_save = $maxlen;
|
|
||||||
# create menu:
|
# create menu:
|
||||||
$B = "<blackI>";
|
$B = "<blackI>";
|
||||||
$BB = "</blackI>";
|
$BB = "</blackI>";
|
||||||
@@ -876,14 +884,13 @@ sub interactive
|
|||||||
. $B . "Q" . $BB . "-Quit] "; # $CurTopic will be empty if $TOPIC is off!
|
. $B . "Q" . $BB . "-Quit] "; # $CurTopic will be empty if $TOPIC is off!
|
||||||
# per default let's list all the stuff:
|
# per default let's list all the stuff:
|
||||||
# Initially do a list command!
|
# Initially do a list command!
|
||||||
$maxlen += $timelen if($DEFAULT_LIST ne "LONG");
|
$ListType = ($DEFAULT_LIST eq "LONG") ? "LONG" : "";
|
||||||
print "\n";
|
|
||||||
&list;
|
&list;
|
||||||
undef $SetTitle;
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
$ListType = "";
|
$ListType = ($DEFAULT_LIST eq "LONG") ? "LONG" : "";
|
||||||
$maxlen = $maxlen_save;
|
undef $SetTitle;
|
||||||
if($CurDepth > 2)
|
if($CurDepth > 2)
|
||||||
{
|
{
|
||||||
print C $menu . $TOPICC . "../" . $CurTopic . $_TOPICC . ">";
|
print C $menu . $TOPICC . "../" . $CurTopic . $_TOPICC . ">";
|
||||||
@@ -899,35 +906,28 @@ sub interactive
|
|||||||
chomp $char;
|
chomp $char;
|
||||||
if($char =~ /^\d+\s*[\di*?,*?\-*?]*$/)
|
if($char =~ /^\d+\s*[\di*?,*?\-*?]*$/)
|
||||||
{
|
{
|
||||||
|
$ListType = ""; #overrun
|
||||||
# display notes
|
# display notes
|
||||||
$maxlen += $timelen;
|
|
||||||
$number = $char;
|
$number = $char;
|
||||||
&display;
|
&display;
|
||||||
undef $SetTitle;
|
|
||||||
}
|
}
|
||||||
elsif($char =~ /^n$/i)
|
elsif($char =~ /^n$/i)
|
||||||
{
|
{
|
||||||
# create a new one
|
# create a new one
|
||||||
&new;
|
&new;
|
||||||
}
|
}
|
||||||
elsif($char =~ /^l$/ || $char =~ /^$/)
|
elsif($char =~ /^$/)
|
||||||
{
|
{
|
||||||
# list
|
|
||||||
print "\n";
|
|
||||||
if($DEFAULT_LIST eq "LONG" && $char =~ /^$/) {
|
|
||||||
$ListType = "LONG";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$ListType = "";
|
|
||||||
$maxlen += $timelen;
|
|
||||||
}
|
|
||||||
&list;
|
&list;
|
||||||
undef $SetTitle;
|
}
|
||||||
|
elsif($char =~ /^l$/)
|
||||||
|
{
|
||||||
|
$ListType = "";
|
||||||
|
&list;
|
||||||
}
|
}
|
||||||
elsif($char =~ /^L$/)
|
elsif($char =~ /^L$/)
|
||||||
{
|
{
|
||||||
$ListType = "LONG";
|
$ListType = "LONG";
|
||||||
print "\n";
|
|
||||||
&list;
|
&list;
|
||||||
undef $SetTitle;
|
undef $SetTitle;
|
||||||
}
|
}
|
||||||
@@ -1005,10 +1005,7 @@ sub interactive
|
|||||||
{
|
{
|
||||||
$CurDepth-- if ($CurDepth > 1);
|
$CurDepth-- if ($CurDepth > 1);
|
||||||
$CurTopic = $LastTopic[$CurDepth];
|
$CurTopic = $LastTopic[$CurDepth];
|
||||||
$maxlen += $timelen;
|
|
||||||
print "\n";
|
|
||||||
&list;
|
&list;
|
||||||
undef $SetTitle;
|
|
||||||
}
|
}
|
||||||
elsif($char =~ /^l\s+(\w+)$/)
|
elsif($char =~ /^l\s+(\w+)$/)
|
||||||
{
|
{
|
||||||
@@ -1020,11 +1017,9 @@ sub interactive
|
|||||||
$LastTopic[$CurDepth] = $CurTopic;
|
$LastTopic[$CurDepth] = $CurTopic;
|
||||||
$CurTopic = $1;
|
$CurTopic = $1;
|
||||||
$CurDepth++;
|
$CurDepth++;
|
||||||
print "\n";
|
|
||||||
$ListType = "";
|
|
||||||
$maxlen += $timelen;
|
|
||||||
&list;
|
&list;
|
||||||
undef $SetTitle;
|
|
||||||
$CurTopic = $LastTopic[$CurDepth];
|
$CurTopic = $LastTopic[$CurDepth];
|
||||||
$CurDepth--;
|
$CurDepth--;
|
||||||
%TP = %SaveTP;
|
%TP = %SaveTP;
|
||||||
@@ -1044,11 +1039,8 @@ sub interactive
|
|||||||
$char = $unchar if(exists $TP{$unchar});
|
$char = $unchar if(exists $TP{$unchar});
|
||||||
$LastTopic[$CurDepth] = $CurTopic;
|
$LastTopic[$CurDepth] = $CurTopic;
|
||||||
$CurTopic = $char;
|
$CurTopic = $char;
|
||||||
$maxlen += $timelen;
|
|
||||||
$CurDepth++;
|
$CurDepth++;
|
||||||
print "\n";
|
|
||||||
&list;
|
&list;
|
||||||
undef $SetTitle;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1111,23 +1103,49 @@ Options:
|
|||||||
#print "called from line $line\n";
|
#print "called from line $line\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub find_editor {
|
sub find_editor {
|
||||||
return $PreferredEditor || $ENV{"VISUAL"} || $ENV{"EDITOR"} || "vim" || "vi" || "pico";
|
return $PreferredEditor || $ENV{"VISUAL"} || $ENV{"EDITOR"} || "vim" || "vi" || "pico";
|
||||||
}
|
}
|
||||||
|
|
||||||
#/
|
#/
|
||||||
|
|
||||||
|
sub format {
|
||||||
|
# make text bold/underlined/inverse using current $NOTEC
|
||||||
|
# s/\[([^]]*)\]/$param{$1}/g;
|
||||||
|
my($note) = @_;
|
||||||
|
if($FormatText) {
|
||||||
|
my $BN = uc($NOTEC);
|
||||||
|
my $_BN = uc($_NOTEC);
|
||||||
|
my $UN = $NOTEC;
|
||||||
|
$UN =~ s/<(.*)>/<$1_>/;
|
||||||
|
my $_UN = $UN;
|
||||||
|
$_UN =~ s/<(.*)>/<\/$1>/;
|
||||||
|
my $IN = $NOTEC; my $_IN = $_NOTEC;
|
||||||
|
$IN =~ s/<(.*)>/<$1I>/;
|
||||||
|
$_IN =~ s/<(.*)>/<$1I>/;
|
||||||
|
#$note =~ s/ (\*)(.+)(\*) / $BN$2$_BN /g;
|
||||||
|
#$note =~ s/ (_)(.+)(_) / $UN$2$_UN /g;
|
||||||
|
#$note =~ s/ (\/)(.+)(\/) / $IN$2$_IN /g;
|
||||||
|
$note =~ s/\*\*([^\*^\*]*)\*\*/$BN$1$_BN/g;
|
||||||
|
$note =~ s/__([^_^_]*)__/$UN$1$_UN/g;
|
||||||
|
$note =~ s/{{([^}^}]*)}}/$IN$1$_IN/g;
|
||||||
|
}
|
||||||
|
$note =~ s/(<\/.*>)/$1$NOTEC/g;
|
||||||
|
$note;
|
||||||
|
}
|
||||||
|
|
||||||
sub output
|
sub output
|
||||||
{
|
{
|
||||||
my($SSS, $LINE, $num, $note, $time, $TYPE, $L, $LONGSPC, $R, $PathLen, $SP, $title, $CUTSPACE,
|
my($SSS, $LINE, $num, $note, $time, $TYPE, $L, $LONGSPC, $R, $PathLen, $SP, $title, $CUTSPACE,
|
||||||
$len, $diff, $Space, $nlen);
|
$len, $diff, $Space, $nlen, $txtlen);
|
||||||
($num, $note, $time, $TYPE) = @_;
|
($num, $note, $time, $TYPE) = @_;
|
||||||
if($ListType ne "LONG")
|
$txtlen = ($ListType eq "LONG") ? $maxlen : $timelen + $maxlen;
|
||||||
{
|
|
||||||
$SSS = "-" x ($maxlen + 31 - $timelen);
|
$note = &format($note);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$SSS = "-" x ($maxlen + 31);
|
$SSS = "-" x ($maxlen + 31);
|
||||||
}
|
|
||||||
$nlen = length("$num");
|
$nlen = length("$num");
|
||||||
$LINE = "$BORDERC $SSS $_BORDERC\n";
|
$LINE = "$BORDERC $SSS $_BORDERC\n";
|
||||||
$L = $BORDERC . "[" . $_BORDERC;
|
$L = $BORDERC . "[" . $_BORDERC;
|
||||||
@@ -1140,14 +1158,7 @@ sub output
|
|||||||
{
|
{
|
||||||
$SP = "";
|
$SP = "";
|
||||||
# print only if it is the first line!
|
# print only if it is the first line!
|
||||||
if($ListType ne "LONG")
|
|
||||||
{
|
|
||||||
$SP = " " x ($maxlen-2 - $timelen - $PathLen);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$SP = " " x ($maxlen - 2 - $PathLen);
|
$SP = " " x ($maxlen - 2 - $PathLen);
|
||||||
}
|
|
||||||
if(!$Raw) {
|
if(!$Raw) {
|
||||||
# no title in raw-mode!
|
# no title in raw-mode!
|
||||||
print C $LINE;
|
print C $LINE;
|
||||||
@@ -1175,12 +1186,12 @@ sub output
|
|||||||
$SetTitle = 1;
|
$SetTitle = 1;
|
||||||
}
|
}
|
||||||
$title = "";
|
$title = "";
|
||||||
$CUTSPACE = " " x $maxlen;
|
$CUTSPACE = " " x $txtlen;
|
||||||
$note =~ s/\n/$CUTSPACE/g;
|
$note =~ s/\n/$CUTSPACE/g;
|
||||||
$len = length($note);
|
$len = length($note);
|
||||||
if($len < ($maxlen - 2 - $nlen))
|
if($len < ($txtlen - 2 - $nlen))
|
||||||
{
|
{
|
||||||
$diff = $maxlen - $len;
|
$diff = $txtlen - $len;
|
||||||
$Space = " " x $diff;
|
$Space = " " x $diff;
|
||||||
if(!$Raw) {
|
if(!$Raw) {
|
||||||
if($num eq "-")
|
if($num eq "-")
|
||||||
@@ -1198,7 +1209,7 @@ sub output
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$title = substr($note,0,($maxlen - 2 - $nlen));
|
$title = substr($note,0,($txtlen - 2 - $nlen));
|
||||||
if(!$Raw) {
|
if(!$Raw) {
|
||||||
$title = $BORDERC . $NOTEC . "\"" . $title . "...\"$_NOTEC$_BORDERC";
|
$title = $BORDERC . $NOTEC . "\"" . $title . "...\"$_NOTEC$_BORDERC";
|
||||||
}
|
}
|
||||||
@@ -1226,10 +1237,7 @@ sub output
|
|||||||
{
|
{
|
||||||
# we will not reach this in raw-mode, therefore no decision here!
|
# we will not reach this in raw-mode, therefore no decision here!
|
||||||
chomp $note;
|
chomp $note;
|
||||||
$Space = " " x ($maxlen - 16);
|
$Space = " " x (($maxlen + $timelen) - 16);
|
||||||
$SP = " " x ($maxlen + 13);
|
|
||||||
#print C $LINE;
|
|
||||||
#print C "$L $NUMC#$_NUMC " . $TIMEC . "creation date$_TIMEC$SP$R\n";
|
|
||||||
print C $LINE;
|
print C $LINE;
|
||||||
print C "$L $NUMC$num$_NUMC $R$L$TIMEC$time$_TIMEC $Space$R\n";
|
print C "$L $NUMC$num$_NUMC $R$L$TIMEC$time$_TIMEC $Space$R\n";
|
||||||
print C $LINE;
|
print C $LINE;
|
||||||
@@ -1496,7 +1504,7 @@ sub getconfig
|
|||||||
while(<CONFIG>) {
|
while(<CONFIG>) {
|
||||||
chomp;
|
chomp;
|
||||||
next if(/^\s*$/ || /^\s*#/);
|
next if(/^\s*$/ || /^\s*#/);
|
||||||
my ($option,$value) = split /\s\s*/, $_, 2;
|
my ($option,$value) = split /\s\s*=?\s*/, $_, 2;
|
||||||
$value =~ s/\s*$//;
|
$value =~ s/\s*$//;
|
||||||
$home = $value if (/^Home/);
|
$home = $value if (/^Home/);
|
||||||
$libpath = $value if (/^LibPath/);
|
$libpath = $value if (/^LibPath/);
|
||||||
@@ -1512,23 +1520,31 @@ sub getconfig
|
|||||||
$NOTEDB = $value if (/^NoteDb/);
|
$NOTEDB = $value if (/^NoteDb/);
|
||||||
$MAX_NOTE = $value if (/^MaxNoteByte/);
|
$MAX_NOTE = $value if (/^MaxNoteByte/);
|
||||||
$MAX_TIME = $value if (/^MaxTimeByte/);
|
$MAX_TIME = $value if (/^MaxTimeByte/);
|
||||||
$USE_CRYPT = "YES" if (/^UseEncryption/ && $value == 1);
|
|
||||||
$CRYPT_METHOD = $value if (/^CryptMethod/);
|
$CRYPT_METHOD = $value if (/^CryptMethod/);
|
||||||
|
$USE_CRYPT = "YES" if (/^UseEncryption/ && $value == 1);
|
||||||
|
$USE_CRYPT = undef if (/^UseEncryption/ && $value == 0);
|
||||||
$ALWAYS_INT = "YES" if (/^AlwaysInteractive/ && $value == 1);
|
$ALWAYS_INT = "YES" if (/^AlwaysInteractive/ && $value == 1);
|
||||||
|
$ALWAYS_INT = undef if (/^AlwaysInteractive/ && $value == 0);
|
||||||
$DEFAULT_LIST = "LONG" if (/^DefaultLong/ && $value == 1);
|
$DEFAULT_LIST = "LONG" if (/^DefaultLong/ && $value == 1);
|
||||||
|
$DEFAULT_LIST = undef if (/^DefaultLong/ && $value == 0);
|
||||||
$ALWAYS_EDIT = "YES" if (/^AlwaysEditor/ && $value == 1);
|
$ALWAYS_EDIT = "YES" if (/^AlwaysEditor/ && $value == 1);
|
||||||
|
$ALWAYS_EDIT = undef if (/^AlwaysEditor/ && $value == 0);
|
||||||
$KEEP_TIMESTAMP = "YES" if (/^KeepTimeStamp/ && $value == 1);
|
$KEEP_TIMESTAMP = "YES" if (/^KeepTimeStamp/ && $value == 1);
|
||||||
|
$KEEP_TIMESTAMP = undef if (/^KeepTimeStamp/ && $value == 0);
|
||||||
|
$COLOR = "YES" if (/^UseColors/ && $value == 1);
|
||||||
|
$COLOR = "NO" if (/^UseColors/ && $value == 0);
|
||||||
$TopicSep = $value if (/^TopicSeparator/);
|
$TopicSep = $value if (/^TopicSeparator/);
|
||||||
$maxlen = $value if (/^MaxLen/);
|
$maxlen = $value if (/^MaxLen/);
|
||||||
$COLOR = "YES" if (/^UseColors/ && $value == 1);
|
|
||||||
$BORDER_COLOR = $value if (/^BorderColor/);
|
$BORDER_COLOR = $value if (/^BorderColor/);
|
||||||
$NUM_COLOR = $value if (/^NumberColor/);
|
$NUM_COLOR = $value if (/^NumberColor/);
|
||||||
$NOTE_COLOR = $value if(/^NoteColor/);
|
$NOTE_COLOR = $value if(/^NoteColor/);
|
||||||
$TIME_COLOR = $value if (/^TimeColor/);
|
$TIME_COLOR = $value if (/^TimeColor/);
|
||||||
$TOPIC_COLOR = $value if (/^TopicColor/);
|
$TOPIC_COLOR = $value if (/^TopicColor/);
|
||||||
|
$PreferredEditor = $value if (/^PreferredEditor/);
|
||||||
|
$FormatText = $value if (/^FormatText/);
|
||||||
}
|
}
|
||||||
chomp $home;
|
chomp $home;
|
||||||
$home =~ s/\/*$//;
|
$home =~ s/\/*$//; # cut eventually / at the end
|
||||||
$HOME = eval($home);
|
$HOME = eval($home);
|
||||||
if($NOTEDB =~ /^(~\/)(.*)$/) {
|
if($NOTEDB =~ /^(~\/)(.*)$/) {
|
||||||
$NOTEDB = "/home/" . $USER . "/" . $2;
|
$NOTEDB = "/home/" . $USER . "/" . $2;
|
||||||
@@ -1544,6 +1560,9 @@ sub getconfig
|
|||||||
__END__
|
__END__
|
||||||
#
|
#
|
||||||
# $Log: note,v $
|
# $Log: note,v $
|
||||||
|
# Revision 1.27 2000/05/16 23:51:35 thomas
|
||||||
|
# fixed many option-parsing related bugd!
|
||||||
|
#
|
||||||
# Revision 1.26 2000/05/13 01:05:17 thomas
|
# Revision 1.26 2000/05/13 01:05:17 thomas
|
||||||
# changed config format and fixed some bugs
|
# changed config format and fixed some bugs
|
||||||
# as well as some other additions...
|
# as well as some other additions...
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# 1.0.5 -*- sh -*-
|
# 1.0.6 -*- sh -*-
|
||||||
# This is a sample config for the note script
|
# This is a sample config for the note script
|
||||||
# There are useful defaults set in note itself.
|
# There are useful defaults set in note itself.
|
||||||
#
|
#
|
||||||
@@ -137,6 +137,11 @@ TopicColor BLACK
|
|||||||
# for inverted color append an "I" (greenI will be inverted green)
|
# for inverted color append an "I" (greenI will be inverted green)
|
||||||
|
|
||||||
|
|
||||||
|
# Additional to colors, you can also do a little bit of formatting your
|
||||||
|
# notes (bold, underlined, italic), see README!
|
||||||
|
# You need to set this Option to 1, if you decide to make use of this
|
||||||
|
# capabily
|
||||||
|
FormatText 1
|
||||||
|
|
||||||
# That's all about it for now.
|
# That's all about it for now.
|
||||||
# If you still have any questiosn, please feel free to contact
|
# If you still have any questiosn, please feel free to contact
|
||||||
|
|||||||
55
stresstest.sh
Executable file
55
stresstest.sh
Executable file
@@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# create notes with topics which then represents the corresponding
|
||||||
|
# directory structure. Depending on how many files the directory
|
||||||
|
# contains, the resulting note-database may become very large.
|
||||||
|
# It will then have thousands of notes!
|
||||||
|
STARTDIR=$1
|
||||||
|
case $STARTDIR in
|
||||||
|
"")
|
||||||
|
echo "usage: stresstest.sh <directory>"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
LOCPFAD=`echo $STARTDIR | grep "^[a-zA-Z0-9.]"`
|
||||||
|
case $LOCPFAD in
|
||||||
|
"")
|
||||||
|
#echo nix
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
STARTDIR=`echo $STARTDIR | sed 's/^\.*//'`
|
||||||
|
STARTDIR="`pwd`/$STARTDIR"
|
||||||
|
STARTDIR=`echo $STARTDIR | sed 's/\/\//\//g'`
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
stress ()
|
||||||
|
{
|
||||||
|
FILES=""
|
||||||
|
for file in `ls $1|sort`
|
||||||
|
do
|
||||||
|
echo "$1/$file"
|
||||||
|
if [ -d "$1/$file" ] ; then
|
||||||
|
stress "$1/$file"
|
||||||
|
else
|
||||||
|
#echo "$1/" > /tmp/$$
|
||||||
|
#echo $file >> /tmp/$$
|
||||||
|
#`cat /tmp/$$ | note -`
|
||||||
|
FILES="$FILES $file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "$1/" > /tmp/$$
|
||||||
|
echo "$FILES" >> /tmp/$$
|
||||||
|
case $FILES in
|
||||||
|
"")
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
RES=`cat /tmp/$$ | note -`
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
FILES=""
|
||||||
|
}
|
||||||
|
|
||||||
|
stress $STARTDIR
|
||||||
Reference in New Issue
Block a user