lightsystemdarkgreen
raw
current commit
261119.1 · The project is dirview and its command drvu

Options and environment

drvu --help prints the options in short. Here is each in full.

drvu-public takes six of these: -a, --share, --disk, which it requires, --cache, --debug and --base, with -V and -h. It takes no directory. drvu-public --help prints them, and doc/online-repos.md says what it serves.

Options follow GNU style. Short ones combine, as in -pa 127.31.1.2, and options may follow the directory. Optional values go joined, as in --share=192.168.1.5; with a space the address would be read as the directory, and drvu says so. -f and -n mean force and dry run in every tool of the author’s, so --foreground and --no-open have no short form. The help text is written in docopt notation, except that docopt has no way to write the optional =HOST.

--list and --kill print keyval: three lines per tree, sorted, with every index the same width. The binary line is missing for a server that started before drvu recorded it.

tree.0.binary /usr/bin/drvu
tree.0.dir /home/t/keep/notes
tree.0.url http://127.31.1.1/keep/notes/
tree.1.binary /home/t/scratch/github.com/unixfile/dirview/build/drvu
tree.1.dir /home/t/scratch/github.com/unixfile/dirview
tree.1.url http://127.31.1.1:8080/scratch/github.com/unixfile/dirview/

Two variables set the default addresses. --help shows each value and where it comes from, and an error from a bad value names its variable.

A third sets how a start opens its URL. DRVU_OPEN holds the command, split at spaces, with %s where the URL goes, or the URL appended when no %s is given. DRVU_OPEN='brave-browser --app=%s' opens a tree in an app window and DRVU_OPEN=firefox in Firefox. It applies to loopback starts only; a share opens through xdg-open, as every start does without the variable. A window of its own, without tabs or an address bar, needs --app=%s, which Brave, Chrome, Chromium, Edge, Vivaldi and Opera take. Firefox has no such flag; firefox --new-window opens a window with its usual bars. surf %s opens a WebKit window with none.

A fourth holds a share’s token. DRVU_SECRET gives --secret a token of letters, digits, - and _ instead of a random one. The token never goes on the command line, where ps shows it to every local user and the shell keeps it in its history, so --secret=token fails with E22. --help says whether the variable is set but never shows its value.