From e4cf9ff0155b63065251ea98f01d799f4ab45624 Mon Sep 17 00:00:00 2001 From: "git@daemon.de" Date: Wed, 3 Jul 2013 11:38:56 +0200 Subject: [PATCH] minor fixes --- Changelog | 7 +++++ NOTEDB.pm | 4 +-- VERSION | 2 +- bin/note | 78 +++++++++++++++++++++++++++++++++++++++++++++++++-- config/noterc | 2 +- 5 files changed, 87 insertions(+), 6 deletions(-) diff --git a/Changelog b/Changelog index 3e2499f..78a95fb 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,10 @@ +1.3.17: + applied patch by Bill Carlson, which fixes string length issues + in non-interactive search mode. + + fixed usage text (-h) so that it now contains the available + options. +================================================================================ 1.3.16: fixed checking of encrypted notes when encryption is turned off. instead of checking note id 1, we now check the first entry, diff --git a/NOTEDB.pm b/NOTEDB.pm index 45badc0..afd28ef 100644 --- a/NOTEDB.pm +++ b/NOTEDB.pm @@ -2,7 +2,7 @@ # this is a generic module, used by note database # backend modules. # -# Copyright (c) 2000-2012 Thomas Linden +# Copyright (c) 2000-2013 Thomas Linden package NOTEDB; @@ -10,7 +10,7 @@ package NOTEDB; use Exporter (); use vars qw(@ISA @EXPORT $crypt_supported); -$NOTEDB::VERSION = "1.37"; +$NOTEDB::VERSION = "1.38"; BEGIN { # make sure, it works, otherwise encryption diff --git a/VERSION b/VERSION index 25b22e0..ef40e4d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.16 +1.3.17 diff --git a/bin/note b/bin/note index 305e902..712c103 100755 --- a/bin/note +++ b/bin/note @@ -1,7 +1,7 @@ #!/usr/bin/perl # # note - console notes management with database and encryption support. -# Copyright (C) 1999-2012 Thomas Linden (see README for details!) +# Copyright (C) 1999-2013 Thomas Linden (see README for details!) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -144,7 +144,7 @@ $CONF = File::Spec->catfile($ENV{HOME}, ".noterc"); $USER = getlogin || getpwuid($<); chomp $USER; $TOPIC = 1; -$version = "1.3.16"; +$version = "1.3.17"; $CurDepth = 1; # the current depth inside the topic "directory" structure... $maxlen = "auto"; $timelen = 22; @@ -583,6 +583,7 @@ sub search { %res = $db->get_search($searchstring); my $nummatches = scalar keys %res; + &determine_width; foreach $num (sort { $a <=> $b } keys %res) { if ($nummatches == 1) { output($num, $res{$num}->{'note'}, $res{$num}->{'date'}, "SINGLE"); @@ -1306,6 +1307,79 @@ It comes with absolutely NO WARRANTY. It is distributed under the terms of the GNU General Public License. Use it at your own risk :-) Usage: note [ options ] [ number [,number...]] + +Options: + + -c, --config file + Use another config file than the default \$HOME/.noterc. + + -l, --list [topic] + Lists all existing notes. If no topic were specified, it will + display a list of all existing topics. See the section TOPICS for + details about topics. + + -L, --longlist [topic] + The same as -l but prints also the timestamp of the notes. + + -t, --topic + Prints a list of all topics as a tree. + + -T, --longtopic + Prints the topic-tree with the notes under each topic. + + -s, --search string + Searches for trough the notes database. See the section + SEARCHING for details about the search engine. + + -e, --edit number + Edit the note with the number using your default editor or + the one you specified in the config file. + + -d, --delete number + Delete the note with the number . You can delete multiple + notes with one command. "1-4" deletes the notes 1,2,3,4. And + "1,5,7" deletes the specified ones. + + -D, --Dump [file | -] + Dumps all notes to the textfile . If is a "-" it will + be printed out to standard output (STDOUT). + + -I, --Import file | - + Imports a previously dumped textfile into the note database. Data + will be appended by default. You can also specify a dash note -I - + instead of a , which causes note, silently to read in a dump + from STDIN. + + -o, --overwrite + Only suitable for use with --Import. Overwrites an existing notedb. + Use with care. + + -r, --raw + Raw mode, output will not be formatted. Works not in interactive + mode, only on cmd-line for list and display. That means, no colors + will be used and no lines or titles. + + -i, --interactive + Start note in interactive mode. See the section INTERACTIVE MODE + for details on this mode. + + --encrypt cleartext + Encrypt the given clear text string. You would need that if you + want to store the mysql password not in cleartext in the config(if + you are using the mysql backend!). + + -h, --help + Display this help screen. + + -v, --version + Display the version number. + + - If you run note just with one dash: note -, then it will read in a + new note from STDIN until EOF. This makes it possible to pipe text + into a new note, i.e.: + + cat sometextfile | note - + Read the note(1) manpage for more details. ~; exit 1; diff --git a/config/noterc b/config/noterc index f239d6f..668b45a 100644 --- a/config/noterc +++ b/config/noterc @@ -5,7 +5,7 @@ # # Copy it to your $HOME as .noterc # - # note is Copyright (c) 1999-2012 Thomas Linden. + # note is Copyright (c) 1999-2013 Thomas Linden. # You can contact me per email: # # Comments start with #, empty lines will be ignored.