Skip to content

Commit 1242de2

Browse files
committed
part written manual page
1 parent 1ca80ce commit 1242de2

File tree

3 files changed

+131
-19
lines changed

3 files changed

+131
-19
lines changed

notebook.1

Whitespace-only changes.

notes

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,14 @@ note_import () {
158158
notefile="`basename ${toimport}`"
159159
notefile="`echo ${notefile} | tr ' ' '_'`"
160160

161+
echo $toimport
162+
echo $pathname
163+
echo $notefile
164+
161165
get_recipient
162166

163167
if [ -f "${toimport}" ] ; then
164-
$GPG -e -r $KEY $GPG_OPTS -o "${USE_POINTER}/${notefile}.gpg" "${notefile}"
168+
$GPG -e -r $KEY $GPG_OPTS -o "${USE_POINTER}/${notefile}.gpg" "${pathname}/${notefile}"
165169
fi
166170
}
167171

@@ -336,6 +340,7 @@ GPG encrypted notes system for BSD and Linux systems
336340
SYSTEM:
337341
338342
notes init initialize notes system
343+
notes config display config file
339344
notes newkey change GPG key
340345
notes help show help
341346
notes version show version
@@ -370,6 +375,10 @@ cmd_version () {
370375
echo "Version $VERSION"
371376
}
372377

378+
cmd_config () {
379+
cat $CONFIGFILE
380+
}
381+
373382
cmd_view () {
374383
myoptions="$@"
375384
if [ "$1" = "" ]; then
@@ -524,6 +533,7 @@ COMMAND="$1"
524533

525534
case "$1" in
526535
init) shift; cmd_init "$@" ;;
536+
config) shift; cmd_config "$@" ;;
527537
default) shift; cmd_default "$@" ;;
528538
use) shift; cmd_use "$@" ;;
529539
newkey) shift; cmd_newkey "$@" ;;

notes.1

Lines changed: 120 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,86 @@
55
.SH NAME
66
notes \- maintain GPG encrypted notes
77
.SH SYNOPSIS
8-
notes [command] [filename | note title]
8+
.B
9+
notes
10+
[
11+
.I
12+
command
13+
] [
14+
.I
15+
filename
16+
|
17+
.I note_title
18+
]
919

1020
.SH CONFIGURATION
1121
Manual configuration for the GPG key can be added using the phrase
22+
23+
.B
1224
KEY <email address>
25+
1326
in the file <notesdir>/config
1427
.SH DESCRIPTION
1528
The Standard(?) Unix Notes notebook system is a GPG encrypted 'notebook' where each note is individually encrypted into a notebook folder. It can handle multiple notebook folders and can decrypt/re-encrypt for a new GPG key easily. The program is based upon Password-Store the standard Unix password manager of which it borrows some code.
29+
30+
If no command is given then Notes simply runs 'notes help' which outputs a list of commands to STDOUT.
31+
32+
Before using the system the user should create a GPG key if they haven't got one. Notes will automatically search the user's GPG keyring and default to using the first private key it finds (Note that the code currently isn't clever enough to distinguish if that key is expired). If this is the wrong key you can change it in two ways:
33+
1. Simply edit the ~/.notes/config file and replace the KEY parameter with the correct email address. This will only work if you only have one key with that email address. If you have two keys with that email address, (for example if one has expired but you have kept it for decrypting old files) then you should replace the email address with the KEYID of the private key you wish to use.
34+
2. If you know the GPG keyid and there are no duplicate email address issues with other keys, then run 'notes newkey <keyid>'. Notes will replace the keyid automatically in the config file.
1635
.SH COMMANDS
1736
The notes program takes a set of commands which allows the user to manipulate the encrypted notes in the system.
18-
.SH COMMANDS
19-
init initialize notes system
20-
newkey change GPG key
21-
help show help
22-
version show version
23-
show|ls|list list notes in current notebook
24-
newkey email change GPG key
37+
.TP
38+
\fBinit\fP
39+
Initialize notes system, assigns first private key and write config file
40+
.TP
41+
\fBconfig\fP
42+
Display config file
43+
.TP
44+
\fBhelp\fP
45+
Show help
46+
.TP
47+
\fBversion\fP
48+
Show version
49+
.TP
50+
\fBshow|ls|list\fP
51+
List notes in currently used notebook
52+
.TP
53+
\fBnewkey email\fP
54+
Change GPG key encryption for all notebooks
55+
.TP
56+
\fBfind|search\fP
57+
[Search is currently not implemented]
58+
.TP
59+
\fBinsert|add\fP
60+
Add a note
61+
.TP
62+
\fBview|cat\fP
63+
View a note
64+
.TP
65+
\fBimport\fP
66+
Import a text file as a note
67+
.TP
68+
\fBrename|mv\fP
69+
Rename a note
70+
.TP
71+
\fBcopy|cp\fP
72+
Copy a note
73+
.TP
74+
\fBdelete|rm\fP
75+
Delete a note
76+
.TP
77+
\fBedit|ed\fP
78+
Decrypt, edit and then re-encrypt a note file
79+
80+
2581

26-
find|search find notes [YET TO BE IMPLEMENTED]
27-
insert|add note_title add a note
28-
view|cat note_title view a note
29-
import file import a text file as a note
30-
rename|mv note_title rename a note (will prompt for new name)
31-
copy|cp note_title copy a note (will prompt for new name)
32-
delete|rm note_title delete a note
33-
edit|ed note_title edit a note
3482

3583

3684

3785

38-
.SH OPTIONS [Normally only in Sections 1, 8]
86+
87+
.SH OPTIONS
3988
Most commands take either a <note title>, filename or a GPG key ID. See the individual COMMANDS for details on which options each command takes.
4089
The notes and notebook commands strip spaces from note filenames and notebook directory names. It replaces them with underscores. This behaviour occurs even if the user encloses the filename with spaces in quotes because there are other issues that occur when handling notes with spaces in - particularly when replacing the encryption key.
4190
.SH EXIT STATUS
@@ -50,7 +99,8 @@ The following files are found in the notes directory (~/.notes by default):
5099
config The configuration file for notes. Currently the only option is for specifying the key to be used for encryption (KEY <email address>)
51100
DEFAULT This link points to the default notebook (notes). This can be reassigned by using the command 'notebook default <notebook name>'
52101
USE This link points to the currently used notebook. It can be changed by issuing the command 'notebook use <notebook name>'. You can also set this to the default notebook by omitting the notebook name parameter.
53-
.SH VERSIONS [Normally only in Sections 2, 3]
102+
.SH VERSIONS
103+
The script is POSIX compliant and should be available to be installed on any Unix-like platform.
54104

55105
.SH CONFORMING TO
56106
The script is written to use the Bourne Shell and avoid all Bash-isms (which would have made the coding a little easier in some cases. Although Bash is installed by default on most Linuxes, it is not installed by default on a number of other Unix-like operating systems including FreeBSD.
@@ -64,5 +114,57 @@ See https://github.com/Standard-Unix-Notes/unix-notes/issues for details on any
64114
Please report any bugs on the GitHub page.
65115
.SH EXAMPLES
66116

117+
Show help
118+
119+
$ notes
120+
121+
Initialises notes directory (~/.notes):
122+
123+
$ notes init
124+
125+
Adds a note called 'mynote' in the current notebook encrypting it with your GPG key:
126+
127+
$ notes add mynote
128+
129+
Add note called another_note in the current notebook encrypting it with your GPG key:
130+
131+
$ notes add another note
132+
133+
Rename 'mynote' to 'installation_instructions':
134+
(Notes will replace space in filename with underscore)
135+
136+
$ notes rename mynote
137+
Please enter new name for note: installation instructions
138+
/home/ian/.notes/USE/mynote.gpg exists .... moving
139+
140+
List notes in current notebooks:
141+
142+
$ notes list
143+
another_note.gpg installation_instructions.gpg
144+
demo.gpg
145+
146+
Import a text file into Notes:
147+
$ notes import ~/Projects/evil_master_plan
148+
149+
Edit a note (.gpg extension not necessary) in your current editor ($EDITOR):
150+
$ notes edit evil_master_plan
151+
152+
Delete Note:
153+
$ notes rm another_note.gpg
154+
155+
View note:
156+
$ notes view evil_master_plan
157+
gpg: encrypted with 2048-bit RSA key, ID 8E34F9151120CF01, created 2020-11-27
158+
"bondVillan64@gmail.com <bondVillan64@gmail.com>"
159+
EVIL MASTER PLAN
160+
161+
1. Take over world
162+
2. Stroke white cat
163+
67164
.SH SEE ALSO
68165
notebook The companion command for managing notebooks for notes. See notebook(1) for details.
166+
.SH PROJECT PAGE
167+
https://github.com/Standard-Unix-Notes/unix-notes
168+
.SH AUTHOR
169+
Ian Stanley (https://github.com/iandstanley)
170+
Contact can be made via project GitHub page

0 commit comments

Comments
 (0)