mirror of
https://codeberg.org/scip/note.git
synced 2025-12-17 12:41:10 +01:00
added 'motd' and changed prompt to show readonly status, if any
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
1.3.14:
|
||||||
|
ADDED: new config parameter 'motd', a note entry which will be shown
|
||||||
|
on startup (if exists).
|
||||||
|
CHANGED: the prompt will now show if the current instance is running
|
||||||
|
in readonly mode.
|
||||||
|
================================================================================
|
||||||
1.3.12:
|
1.3.12:
|
||||||
FIXED: NOTEDB::general data backend module did overwrite records if
|
FIXED: NOTEDB::general data backend module did overwrite records if
|
||||||
there were some deleted ones in the database.
|
there were some deleted ones in the database.
|
||||||
|
|||||||
4
README
4
README
@@ -1,4 +1,4 @@
|
|||||||
note 1.3.12 by Thomas Linden, 07/19/2012
|
note 1.3.13 by Thomas Linden, 14/11/2012
|
||||||
=======================================
|
=======================================
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
@@ -214,4 +214,4 @@ and I'll add you.
|
|||||||
Last changed
|
Last changed
|
||||||
============
|
============
|
||||||
|
|
||||||
07/19/2012
|
14/11/2012
|
||||||
32
bin/note
32
bin/note
@@ -133,7 +133,8 @@ my (
|
|||||||
'topicseparator' => '/',
|
'topicseparator' => '/',
|
||||||
'printlines' => 0,
|
'printlines' => 0,
|
||||||
'cache' => 0,
|
'cache' => 0,
|
||||||
'preferrededitor' => ''
|
'preferrededitor' => '',
|
||||||
|
'motd' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
# these are not customizable at runtime!
|
# these are not customizable at runtime!
|
||||||
@@ -143,7 +144,7 @@ $CONF = File::Spec->catfile($ENV{HOME}, ".noterc");
|
|||||||
$USER = getlogin || getpwuid($<);
|
$USER = getlogin || getpwuid($<);
|
||||||
chomp $USER;
|
chomp $USER;
|
||||||
$TOPIC = 1;
|
$TOPIC = 1;
|
||||||
$version = "1.3.12";
|
$version = "1.3.13";
|
||||||
$CurDepth = 1; # the current depth inside the topic "directory" structure...
|
$CurDepth = 1; # the current depth inside the topic "directory" structure...
|
||||||
$maxlen = "auto";
|
$maxlen = "auto";
|
||||||
$timelen = 22;
|
$timelen = 22;
|
||||||
@@ -534,7 +535,15 @@ sub encrypt_passwd {
|
|||||||
print "Encrypted password:\n$crypt_string\n";
|
print "Encrypted password:\n$crypt_string\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
############################### MOTD ##################################
|
||||||
|
sub motd {
|
||||||
|
my($N,$match,$note,$date,$num);
|
||||||
|
# display a configured motd note, if any
|
||||||
|
($note, $date) = $db->get_single($conf{motd});
|
||||||
|
if ($note) {
|
||||||
|
print "\n\n$note\n\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
############################### DISPLAY ##################################
|
############################### DISPLAY ##################################
|
||||||
sub display {
|
sub display {
|
||||||
@@ -1044,6 +1053,13 @@ sub interactive {
|
|||||||
# Initially do a list command!
|
# Initially do a list command!
|
||||||
&determine_width;
|
&determine_width;
|
||||||
$ListType = ($conf{defaultlong}) ? "LONG" : "";
|
$ListType = ($conf{defaultlong}) ? "LONG" : "";
|
||||||
|
|
||||||
|
# show initial note entry
|
||||||
|
if ($conf{motd}) {
|
||||||
|
&motd;
|
||||||
|
}
|
||||||
|
|
||||||
|
# show initial listing
|
||||||
&list;
|
&list;
|
||||||
|
|
||||||
my ($term, $prompt, $attribs);
|
my ($term, $prompt, $attribs);
|
||||||
@@ -1058,12 +1074,18 @@ sub interactive {
|
|||||||
$ListType = ($conf{defaultlong}) ? "LONG" : "";
|
$ListType = ($conf{defaultlong}) ? "LONG" : "";
|
||||||
undef $SetTitle;
|
undef $SetTitle;
|
||||||
if ($CurDepth > 2) {
|
if ($CurDepth > 2) {
|
||||||
print C $menu . $TOPICC . "../" . $CurTopic . $_TOPICC . ">";
|
print C $menu . $TOPICC . "../" . $CurTopic . $_TOPICC;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print C $menu . $TOPICC . $CurTopic . $_TOPICC . ">";
|
print C $menu . $TOPICC . $CurTopic . $_TOPICC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($conf{readonly}) {
|
||||||
|
print " [readonly] ";
|
||||||
|
}
|
||||||
|
|
||||||
|
print ">";
|
||||||
|
|
||||||
# endless until user press "Q" or "q"!
|
# endless until user press "Q" or "q"!
|
||||||
if ($term) {
|
if ($term) {
|
||||||
if (defined ($char = $term->readline(" "))) {
|
if (defined ($char = $term->readline(" "))) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# note 1.3.8 -*- sh -*-
|
# note 1.3.13 -*- 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.
|
||||||
@@ -277,6 +277,11 @@ PrintLines = NO
|
|||||||
AddTicket = NO
|
AddTicket = NO
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Show an entry on startup. If you want it, create such an entry
|
||||||
|
# and supply its number here
|
||||||
|
motd =
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user