~gbmor/clinte

fe77fcfc5562453e6a408a337bb93ffe240cf94a — Benjamin Morrison 3 months ago 9d8bbab
man page for clinte

Amended Makefile to install said man page.
Explicitly installing files -o root -g root.
2 files changed, 114 insertions(+), 3 deletions(-)

M Makefile
A clinte.1
M Makefile => Makefile +6 -3
@@ 34,10 34,12 @@ install:
	mkdir -p $(DBDIR)

	@printf "\n%s\n" "Copying files..."
	install -m755 target/release/clinte $(BINDIR)
	install -m755 -o root -g root target/release/clinte $(BINDIR)

	@if [ -f "$(DBDIR)/clinte.json" ]; then printf "\n%s\n" "clinte.json exists. Skipping ..."; else install -m666 clinte.json "$(DBDIR)"; fi
	@if [ -e /etc/profile.d ]; then printf "%s\n" "Installing check_new_clinte_posts.sh to /etc/profile.d" && install -m644 check_new_clinte_posts.sh /etc/profile.d/; fi
	@if [ -f "$(DBDIR)/clinte.json" ]; then printf "\n%s\n" "clinte.json exists. Skipping ..."; else install -m666 -o root -g root clinte.json "$(DBDIR)"; fi
	@if [ -e /etc/profile.d ]; then printf "%s\n" "Installing check_new_clinte_posts.sh to /etc/profile.d" && install -m644 -o root -g root check_new_clinte_posts.sh /etc/profile.d/; fi

	install -m644 -o root -g root clinte.1 $(PREFIX)/share/man/man1/

	@printf "\n%s\n" "...Done!"



@@ 51,6 53,7 @@ test:
uninstall:
	@printf "\n%s\n" "Uninstalling clinte..."
	rm -f $(BINDIR)/clinte
	rm -f $(PREFIX)/share/man/man1/clinte.1
	@if [ -e /etc/profile.d ]; then printf "%s\n" "rm -f /etc/profile.d/check_new_clinte_posts.sh" && rm -f /etc/profile.d/check_new_clinte_posts.sh; fi
	@printf "\n%s\n" "...Done!"
	@printf "%s %s\n" "The posts are still intact in" $(DBDIR)

A clinte.1 => clinte.1 +108 -0
@@ 0,0 1,108 @@
.Dd July 3, 2020
.Dt CLINTE 1
.Os
.Sh NAME
.Nm clinte
.Nd Command-line community notes board - CLI NoTEs
.Sh SYNOPSIS
.Nm
.Op Fl v
.Op Fl l Ar length
.Op post
.Op update Ar id
.Op delete Ar id
.
.Sh DESCRIPTION
.Nm
is a command-line community notes board, aimed at public-access UNIX systems.
Users may append a note, which is automatically tagged with their username.
Other users may view all notes, but users may only edit or delete their own.
Upon login, users are notified of unseen notes.
.Pp
All flags and commands are optional.
The default behavior is to display the 15 most recent posts.
.Pp
Subject lines are truncated to 50 characters.
Post bodies are truncated to 500 characters.
.Pp
When creating a new post or editing a previous post,
.Ev $EDITOR
is called.
If
.Ev $EDITOR
is not set,
.Xr nano 1
is called.
.
.Ss Flags
.Bl -tag -width Ds
.It Fl v
Verbose logging.
If there's an error, hopefully something useful will be included in
.Pa /tmp/clinte_$USER.log
.It Fl l Ar length
Specify the line length for wrapping post bodies.
Defaults to 80.
If the value passed is below 10, line wrapping will be disabled.
.El
.
.Ss Commands
.Bl -tag -width Ds
.It Cm post
Compose a new post to add to the notes board.
.
.It Cm update Op Ar id
Edit the post numbered
.Ar id
if it was previously composed by the user.
If
.Ar id
is omitted, the user will be prompted for it.
.
.It Cm delete Op Ar id
Remove a post numbered
.Ar id
if it was previously composed by the user.
If
.Ar id
is omitted, the user will be prompted for it.
.El
.
.Ss Files
Posts are stored chronologically in a file located at
.Pa /usr/local/clinte/clinte.json
.Pp
The format of the file is as follows:
.
.Bd -literal -offset indent
{
    "posts": [
        {
            "title": "sample title",
            "author": "sample author",
            "body": "sample body"
        }
    ]
}
.Ed
.
.
.Ss Notifications
.Nm
installs a script to
.Pa /etc/profile.d/
which notifies you of unseen posts upon logging in.
However, some people may find this behavior to be annoying.
To suppress notifications,
.Xr touch 1
.Pa $HOME/.hushclinte .
.Sh AUTHORS
.An gbmor Aq Mt ben@gbmor.dev
.Sh BUGS
Send a message to the mailing list:
.Mt ~gbmor/clinte@lists.sr.ht
.Pp
You may also open a ticket at:
.Lk https://todo.sr.ht/~gbmor/clinte
.Pp
Or, /msg gbmor on tilde.chat or freenode.
\ No newline at end of file