Compare commits

...

127 Commits

Author SHA1 Message Date
~creme 53c02830c0
Merge pull request #1 from jamestomasino/master
Adds new burrow disambiguity
2022-01-10 13:02:51 +01:00
James Tomasino 459de8117e
Adds new burrow disambiguity 2021-10-22 20:14:14 +00:00
creme 6a8bbc71de
Merge remote-tracking branch 'upstream/master' 2021-08-08 14:16:28 +02:00
James Tomasino b83e5056f1
Merge pull request #37 from zcrayfish/patch-1
Typo in variable name. XDC_CONFIG_HOME > XDG_CONFIG_HOME
2021-08-08 11:13:02 +00:00
Zachary Lee Andrews 91d6113fe3
Typo in variable name. XDC_CONFIG_HOME > XDG_CONFIG_HOME 2021-08-08 02:21:50 -04:00
Sven 2556d9eb40
Merge branch 'jamestomasino:master' into master 2021-07-13 13:54:53 +02:00
James Tomasino 33c1aa0437
Adds additional disambiguity 2021-05-26 12:58:04 +00:00
creme af7d8a31c2
add .drone.yml 2020-05-23 11:09:22 +02:00
creme 2b99bf98e3
Merge remote-tracking branch 'upstream/master' 2020-03-06 15:51:25 +01:00
James Tomasino 8658c7675c rss generation skips files that cant parse date 2020-03-06 12:30:26 +00:00
creme 404cd61586
Merge remote-tracking branch 'upstream/master' 2020-01-09 23:40:05 +01:00
James Tomasino 478f40ce24 disabiguity burrow the burrows 2020-01-08 16:17:56 +00:00
creme b80a1c6789
remove trailing spaces 2019-08-27 22:13:30 +02:00
creme 4b3d7364f9
fork to envs.net 2019-08-07 17:28:57 +02:00
James Tomasino 8e900ca005 removed explicit reference to stdout 2019-08-07 09:44:38 +00:00
James Tomasino e6442c9d6f fixed ! -z to -n 2019-08-07 09:31:35 +00:00
James Tomasino 4c011fc82e
Merge pull request #35 from Munchotaur/readme-bsd
Readme bsd
2019-05-24 08:48:24 -04:00
David Harrison b9a2650819
Tweak OpenBSD instructions in README.md
changed formatting around link.
2019-05-13 13:11:19 +01:00
Munchotaur d3289ebc94 updated README.md BSD instructions 2019-05-13 13:06:41 +01:00
Munchotaur 4a01b598fb updated README.md for FreeBSD and OpenBSD 2019-05-13 13:04:06 +01:00
James Tomasino 05021a7699 updated readme with BSD instructions 2019-05-12 11:59:16 -04:00
James Tomasino d83843fba6
Merge pull request #32 from fosslinux/patch-1
; -> && in .travis-ci.yml
2019-03-01 19:08:41 -05:00
fosslinux e671238848
; -> && in .travis-ci.yml
ensure that shopt completes successfully before running shellcheck
2019-02-27 09:04:37 +11:00
James Tomasino 0b915075e5 XDG_CONFIG_HOME respected if set 2019-02-25 19:45:52 -05:00
James Tomasino f31b5ae218 removed - exception from gophernicus exclusions 2019-02-05 12:49:43 -05:00
James Tomasino cf9e56cc3c fixed typo 2019-01-28 23:11:07 -05:00
James Tomasino e71e2ae579 added a config option for gophernicus setting, defaulted to true 2019-01-28 22:59:02 -05:00
James Tomasino 84cc1efcd5 removing the - gophernicus exclusion 2019-01-28 22:46:05 -05:00
James Tomasino 045e7b8f72 burrow checks for a /etc/burrow/config fallback file 2019-01-27 23:18:13 -05:00
James Tomasino 7782fd066d burrow checks for a /etc/burrow/config fallback file 2019-01-27 23:15:43 -05:00
James Tomasino 39bd2c500a expanded support for ! . ~ : # 2019-01-27 22:57:08 -05:00
James Tomasino 08d172b3f9 burrow autoindent ignores gophernicus special characters = * and % if they begin a line 2019-01-27 22:54:06 -05:00
James Tomasino 22387cc6fe removed .template fallback for posts to plan future implementation of gophermap regeneration 2019-01-21 18:53:15 -05:00
James Tomasino 9f4a61b4f9 version number increase 2019-01-21 13:42:55 -05:00
James Tomasino b646c085c1 force proper directory formatting in quickstart 2019-01-21 13:27:44 -05:00
James Tomasino 982eb95372 fixing yesno prompt for bsd 2019-01-21 13:20:35 -05:00
James Tomasino 9b6f3daeb1 version increment 2019-01-15 19:56:21 -05:00
James Tomasino 1c66e9297d
Merge pull request #27 from pingiun/patch-1
Add space between sed option if OSX detected
2019-01-15 19:54:51 -05:00
Jelle Besseling c2eea80929
Add platform check for sed command
This checks if the current platform is macOS (darwin), which uses a sed version that accepts arguments differently
2019-01-15 11:19:30 +01:00
James Tomasino b6e2d6efa6 linting fixes 2019-01-05 22:17:38 -05:00
James Tomasino 95c008c31a printf in yesno 2019-01-01 23:11:37 -05:00
James Tomasino 4cd0a9f498
Merge pull request #30 from fosslinux/master
Clean up quickstart()
2019-01-01 22:59:32 -05:00
Samuel Tyler 52ace7f214 better yesno function 2019-01-02 14:22:28 +11:00
Samuel Tyler 21688e4fd9 clean up quickstart 2019-01-02 14:16:16 +11:00
James Tomasino 49110809c1 build status from travis 2019-01-01 20:55:28 -05:00
James Tomasino 7158d5eae9 added travisci config 2019-01-01 20:52:23 -05:00
James Tomasino dd3a7d08d1 disambiguity 2018-12-15 12:27:09 -05:00
James Tomasino 2518e999af
Merge pull request #28 from pacoesteban/makefile-fix
Fixing Makefile so:
2018-11-15 10:39:43 -05:00
James Tomasino b715b663ff
Merge pull request #29 from smt/quickstart
Add quickstart command
2018-11-15 10:38:20 -05:00
Stephen Tudor 516f835ad3 Remove BASH_VERSION check, just stick with lowest common denominator ;) 2018-11-15 10:13:51 -05:00
Stephen Tudor a8ec4d6c57 Add quickstart command to create a new config file from interactive prompts and sane defaults 2018-11-15 09:23:27 -05:00
Paco Esteban d890a6ef53 Fixing Makefile so:
* it does not fail on manpage install (folder was not found)
* CPLDIR is always defined as per 3rd condition, even if all fails
* moved from mkdir + cp + chmod to mkdir + install
2018-10-28 17:52:59 +01:00
James Tomasino 29253bc254 fixed small linting error 2018-09-25 15:18:21 -04:00
James Tomasino 7cd512a082 formatting 2018-09-24 22:38:30 -04:00
James Tomasino fc49cbeb90 dont use switches in autocomplete 2018-09-24 22:36:03 -04:00
James Tomasino d9a4f0169e upped version 2018-09-24 22:26:48 -04:00
James Tomasino 2cfeda0340 avoid exploding on new files 2018-09-24 22:24:31 -04:00
James Tomasino 3fed90daef autocomplete is super smart for gophermap 2018-09-24 21:53:15 -04:00
James Tomasino 487574e053 added gophermap editing with awesome bash completion 2018-09-24 21:35:36 -04:00
James Tomasino f0f21df913 remove possible trailing slash from titles in rss feed 2018-09-01 18:55:03 -04:00
Jelle Besseling 986f3df957
Add space between sed option
This fixed the script on macOS, not sure if this will work with other sed versions.
2018-08-14 18:28:47 +02:00
James Tomasino 6dce0f1924 spelling error 2018-07-15 20:32:56 -04:00
James Tomasino d37369df53 small fix for generating burrow roots if never made before 2018-07-15 20:30:51 -04:00
James Tomasino e3f15046b2 added ability to modify root gophermap with "burrow root" 2018-07-15 20:02:15 -04:00
James Tomasino e81fa7d8bd rss fix for type 1 formatting 2018-07-15 11:56:38 -04:00
James Tomasino 9b9377e401 updated version 2018-07-13 16:44:14 -04:00
James Tomasino 3e3bf3a552 rss links properly pathed and typed 2018-07-13 16:43:38 -04:00
James Tomasino 9b2e0221ca small bug fix with last updated touch 2018-07-11 23:48:43 -04:00
James Tomasino cbe6256862 version increased. EDITOR fallback added 2018-07-11 23:44:03 -04:00
James Tomasino e8c105a51c updated version number 2018-07-11 23:39:46 -04:00
James Tomasino 23c2a9909f if root dir exists, create folders from there as defined 2018-07-11 23:36:43 -04:00
James Tomasino d2543cccab error checking to create gophermap properly if not created already 2018-07-11 23:29:41 -04:00
James Tomasino 28e1831369 avoiding copy of tmp file to properly respect umask 2018-07-11 23:18:34 -04:00
James Tomasino 5366ac016b rss item links remove ./ from path 2018-05-01 22:49:37 -04:00
James Tomasino 93e1c41e9c rss feed builds relative links if server and port suppressed 2018-05-01 22:23:48 -04:00
James Tomasino 42892d8cfb missing line breaks 2018-05-01 18:44:32 -04:00
James Tomasino 4d08e72352 testing hidden config switch config_gophermap_omitserver 2018-05-01 18:42:22 -04:00
James Tomasino 2acf982073 title-case rss feed 2018-04-20 20:29:19 -04:00
James Tomasino 6d29f54f93 title-case rss feed 2018-04-20 20:28:12 -04:00
James Tomasino 57eb27f8ad not title-casing rss titles until it can be done posix 2018-04-13 21:18:52 -04:00
James Tomasino 2bc0894201 90% fix for date formatting 2018-04-13 20:43:02 -04:00
James Tomasino de865b1e5a fixed date format of output. still need to fix reading input 2018-04-12 14:39:37 -04:00
James Tomasino 43f504e101 fixed issue with stat 2018-04-12 09:19:54 -04:00
James Tomasino 2a693f66e5 trying column 10 for changing timestamps on BSD stat 2018-04-12 09:07:31 -04:00
James Tomasino 09b031157f flag autoindent isnt set anywhere. remove it 2018-04-11 23:10:19 -04:00
James Tomasino c263bf8903 properly silenced update-git and cd movements 2018-04-11 22:56:39 -04:00
James Tomasino 34b61e9e3a removed bash badge from readme 2018-04-11 22:44:55 -04:00
James Tomasino 3d22e5d275 updated readme and documentation 2018-04-11 22:34:27 -04:00
James Tomasino bc050454ff converted to bourne shell 2018-04-11 22:31:54 -04:00
James Tomasino d79080ac1e version number to 1.4.1 2018-04-09 22:17:38 -04:00
James Tomasino 694e490353 removed unnecessary slash from rss link 2018-04-09 22:11:02 -04:00
James Tomasino 87ffadc19a removed longopts completely for portability 2018-04-09 22:07:57 -04:00
James Tomasino 359dea788b stylistic fixes and shellcheck remediation 2018-04-09 22:00:36 -04:00
James Tomasino b880efa992 avoiding word splitting 2018-04-09 21:57:06 -04:00
James Tomasino 56f5c3f3f6 two minor printf mistakes with --- chars 2018-04-09 21:53:53 -04:00
James Tomasino 7121dd0f29 remaining echos removed 2018-04-09 21:48:04 -04:00
James Tomasino 4535f8f571 rss functions switched from echo to printf 2018-04-09 21:43:16 -04:00
James Tomasino fb193ff7b5 Merge branch 'master' of github.com:jamestomasino/burrow
* 'master' of github.com:jamestomasino/burrow:
  Added Feature Requests section
2018-04-09 21:19:44 -04:00
James Tomasino 4abc2496aa replaced find --not with ! for portability 2018-04-09 21:19:38 -04:00
James Tomasino 3487b590ca
Added Feature Requests section 2018-04-09 20:06:52 -04:00
James Tomasino 00707c3046 readme updated. phlog rss defaults to false 2018-04-02 12:59:57 -04:00
James Tomasino a7dc326a62 parse HTML links for rss 2018-03-31 22:56:32 -04:00
James Tomasino 488e27ea03 rss support added 2018-03-31 22:41:10 -04:00
James Tomasino 445f6a30a9 good as it gets 2018-03-31 22:29:26 -04:00
James Tomasino e981106dcc fixed sed -i alignment 2018-03-31 22:20:52 -04:00
James Tomasino 170817a1eb autorss for phlogs added to config 2018-03-31 22:13:52 -04:00
James Tomasino f49be1126e generate rss feed with burrow rss 2018-03-31 22:06:35 -04:00
James Tomasino 43e903bbb6 generating rss descriptions 2018-03-31 22:03:48 -04:00
James Tomasino 11d6b80757 de-gophermap rss content part 1 2018-03-31 21:36:19 -04:00
James Tomasino 6c67e8f7fa title-case in rss titles 2018-03-31 21:30:08 -04:00
James Tomasino 33ec590cfb Merge branch 'master' into rss
* master:
  removing some gnu requirements
  sed support for bsd or gnu
  removed readme requirement for gnu stat
  wrapped stat in safety function to split between gnu and bsd
2018-03-31 21:28:07 -04:00
James Tomasino 48f0f0ca0c basic rss generation, no description 2018-03-31 21:27:42 -04:00
James Tomasino 6f5bedded3 removing some gnu requirements 2018-03-30 12:07:31 -04:00
James Tomasino 3d5319afb0 sed support for bsd or gnu 2018-03-30 12:06:01 -04:00
James Tomasino 31bc38669f removed readme requirement for gnu stat 2018-03-30 11:50:49 -04:00
James Tomasino 416f8707b1 wrapped stat in safety function to split between gnu and bsd 2018-03-30 11:49:13 -04:00
James Tomasino 6b683df3be acknowledge need for GNU stat 2018-03-23 16:11:30 -04:00
James Tomasino 2403bedda8 upped version number for release 2018-03-17 18:50:46 -04:00
James Tomasino b6ea90a866 switched gophermap sed line to use pipes as delimiter. avoids bugs with paths 2018-03-17 18:49:09 -04:00
James Tomasino ea10ed8356 removing line breaks on more sed chains 2018-03-16 20:37:12 -04:00
James Tomasino 0ea68ff866 dont break up sed line 2018-03-16 20:34:24 -04:00
James Tomasino 496adcbf85 small patch for gophermap date updater to add trailing tabs 2018-03-14 07:40:09 -04:00
James Tomasino e0c264f6ce gophermaps created are fully 100% rfc1436 compliant 2018-03-13 21:11:52 -04:00
James Tomasino 7366097bf0
autoindent handles text that needs "i" not spaces
Probably needs renamed to autoformat or something.
2018-03-11 17:38:01 -04:00
James Tomasino 95c1a61274 upping version number for 1.3.0 2018-03-11 15:56:42 -04:00
James Tomasino 2971b8a998 strict adherence to 1436 spec for gophermaps and editing 2018-03-11 15:54:28 -04:00
James Tomasino 6a00579db2 back to no-break in gophermap creation once again 2018-03-06 23:15:31 -05:00
7 changed files with 735 additions and 424 deletions

26
.drone.yml Normal file
View File

@ -0,0 +1,26 @@
---
kind: pipeline
type: ssh
name: deploy
server:
host:
from_secret: host
user:
from_secret: username
ssh_key:
from_secret: ssh_key
clone:
disable: true
trigger:
branch:
- master
steps:
- name: deploy
commands:
- cd /opt/services/burrow
- sudo -Hu services git pull origin master
- sudo -Hu root make

3
.travis.yml Normal file
View File

@ -0,0 +1,3 @@
language: shell
script:
- bash -c 'shopt -s globstar && shellcheck burrow'

View File

@ -1,6 +1,6 @@
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
MANDIR ?= $(PREFIX)/share/man/man1
# Attempt to find bash completion dir in order of preference
ifneq ($(wildcard /etc/bash_completion.d/.),)
@ -14,23 +14,22 @@ endif
HAS_PKGCONFIG := $(shell command -v pkg-config 2> /dev/null)
ifdef HAS_PKGCONFIG
CPLDIR ?= $$(pkg-config --variable=completionsdir bash-completion 2> /dev/null)
CPLDIR ?= $(shell pkg-config --variable=completionsdir bash-completion 2> /dev/null)
endif
install:
@echo Installing the executable to $(BINDIR)
@mkdir -p $(BINDIR)
@cp -f burrow $(BINDIR)/burrow
@chmod 755 $(BINDIR)/burrow
@install -m 755 burrow $(BINDIR)
@echo Installing the manual page to $(MANDIR)/man1
@mkdir -p $(MANDIR)
@cp -f burrow.1 $(MANDIR)/man1/burrow.1
@chmod 644 $(MANDIR)/man1/burrow.1
@install -m 644 burrow.1 $(MANDIR)
ifdef CPLDIR
ifneq ($(CPLDIR),)
@echo Installing the command completion to $(CPLDIR)
@mkdir -p $(CPLDIR)
@cp -f burrow.d $(CPLDIR)/burrow
@chmod 644 $(CPLDIR)/burrow
@install -m 644 burrow.d $(CPLDIR)/burrow
endif
endif
uninstall:
@ -39,8 +38,10 @@ uninstall:
@echo Removing the manual page from $(MANDIR)/man1
@rm -f $(BINDIR)/man1/burrow.1
ifdef CPLDIR
ifneq ($(CPLDIR),)
@echo Removing the command completion from $(CPLDIR)
@rm -f $(CPLDIR)/burrow
endif
endif
.PHONY: install uninstall

120
README.md
View File

@ -1,91 +1,75 @@
# burrow ![status](https://img.shields.io/badge/status-working-green.svg?style=flat-square) ![license](https://img.shields.io/badge/license-GPL3-blue.svg?style=flat-square) ![bash](https://img.shields.io/badge/Bash-4%2B-lightgrey.svg?style=flat-square)
# burrow ![status](https://travis-ci.com/jamestomasino/burrow.svg?branch=master) ![license](https://img.shields.io/badge/license-GPL3-blue.svg?style=flat-square)
**burrow** is a helper for building and managing a gopher hole.
## Installation
### Dependencies
#### Required
* bash 4+
* Install on OSX: `brew install bash`
#### Recommended
* GNU sed
* Avoids creation of `.bak` files in strange places on OSX
* Install on OSX: `brew install gnu-sed --with-default-names`
* GNU getopt
* Required to use long named switches, like --version or --help instead of -v and -h.
* Install on OSX: `brew install gnu-getopt --with-default-names`
### Install
`sudo make install`
_Note: On systems without admin access the binary can be run directly from the
git repo, but will lack `man` support and command completion._
See the [Getting Started](https://github.com/jamestomasino/burrow/wiki/Getting-Started) guide.
### Install on Linux / MacOS
`sudo make install`
### Install on BSD systems
#### FreeBSD
- Installing bash-completion via either `pkg install bash-completion` or via the `shells/bash-completion` port.
- Installing the GNU version of make via either `pkg install gmake` or the `port devel/gmake`.
- Rather than using `sudo make install`, run `sudo gmake install`.
#### OpenBSD
- Install the GNU version of make via either `pkg_add gmake` or the port `devel/gmake`.
- There is no bash-completion package or port in OpenBSD. However the source code can be found at https://github.com/scop/bash-completion
- Burrow appears to install and run without the presence of bash-completion. Exercise caution.
- As root (or via `doas`), run `gmake install`.
### Uninstall
`sudo make uninstall`
`sudo make uninstall` # or gmake uninstall on BSD
## Usage
```bash
burrow phlog # create new phlog post
burrow recipe # add or update a recipe to box
burrow topic # add or update a topic file
burrow create-config # generate a default config file
burrow gophermap # edit a gophermap
burrow rss # generate a RSS feed of phlog entries
burrow edit-config # open your config file for editing
burrow update-git # pull latest git repo for gopher dir, if exists
burrow update-burrow # update git repo or pull latest version from github
```
- `create-config` will auto-generate a configuration file at
`$HOME/.config/burrow/config`. It will be populated by the default parameters
listed below and provide an easy way to customize your configuration. At a
minimum you should update your `config_dir_gopher` to point to the folder on
your local computer where your gopher hole resides.
- `edit-config` will open your burrow configuration file for easy editing.
- `phlog` will prompt for the title of a new post, then open it in your default
`$EDITOR`. By default it will provide you a template, but you can override this
by including a `.template` file in your phlog directory.
`$EDITOR`.
- `recipe` will prompt for the name of your recipe, then open it in your default
`$EDITOR`. By default it will provide you a template, but you can override this
by including a `.template` file in your recipe box directory.
- `gophermap` will open a gophermap file for editing. This will
remove any `type i` formatting and allow comments to be added in natural text.
You will still need to create links in the proper gophermap formatting.
- `topic` will prompt for the name of the topic, then open it in your default
`$EDITOR`. By default it will provide you a template, but you can override this
by including a `.template` file in your topics directory.
- `rss` will automatically generate an RSS feed of your most recent phlog
entries and output it to the root of your gopher directory. This can be
automatically generated by using the config option `config_phlog_autorss`.
- `update-git` will silently attempt to update a git repository at the location
of your gopher hole. It is appropriate for use by a cron job.
- `update-burrow` will attempt to pull the latest version of burrow from git if
your local folder is a git repository. If not, it will attempt to update each
file in the burrow directory with the same named file in the master branch of
the git repository for burrow on Github.
_`man burrow` or `burrow -h` for more information._
## Config
The following locations are available for configuration:
1) `$HOME/.config/burrow/config`
2) `$HOME/.config/burrow`
3) `$HOME/.burrow`
1) `/etc/burrow/config`
2) `$XDG_CONFIG_HOME`
3) `$HOME/.config/burrow/config`
4) `$HOME/.config/burrow`
5) `$HOME/.burrow`
These files are processed in the order listed. Variables defined in multiple
locations will use the last assigned value.
@ -102,25 +86,33 @@ config_dir_phlog="phlog" # relative path to phlog
config_phlog_gophermap=true # phlogs use gophermap format by default
config_phlog_usedate=true # use a date-stamp on phlog posts
config_dir_recipebox="recipebox" # relative path to recipe box
config_recipebox_gophermap=false # recipes use plain text by default
config_recipebox_usedate=false # do not use a date-stamp on recipe filenames
config_dir_topics="topics" # relative path to topics directory
config_topics_gophermap=true # topic notes use gophermap format by default
config_topics_usedate=false # do not use a date-stamp on topic filenames
config_git_commit=false # automatically commit changes if git repo
config_git_push=false # automatically push changes if git repo
config_autofold=false # automatically break lines at specific width
config_foldwidth=66 # width of line used for autofold
config_autoindent=true # automatically reformat gophermaps with leading spaces
# and parse links at the end of file
config_autoindent=true # automatically reformat gophermaps with leading "i"
# types and parse links at the end of file
config_file_rss="rss.xml" # filename of RSS feed
config_gopher_name="My Gopher Hole" # used in RSS feed output
config_gopher_desc="Description" # used in RSS feed output
config_rss_num_entries="10" # number of entries to inclued in RSS feed
config_phlog_autorss=false # automatically generate RSS feed
```
_Note: This file is a valid Bash script and will be sourced upon load._
## Disambiguity
There is [another burrow project](https://github.com/sloumdrone/burrow) created
by _sloumdrone_. His burrow project is a GUI gopher client. Please check it out!
There is also another project called "Burrow the Burrows" which can be found on gopher at: `gopher://kalos.mine.nu/1/burrow/index.gph`. It aims to construct and maintain a graph of the whole Gopherspace.
There is another [static site generator for gopher](https://github.com/hyperrealgopher/burrow) written in Haskell by @hyperrealgopher. It has similar features to my burrow.
_Armen_ now has a [gemini & spartan server](https://gitlab.com/armen138/burrow) named burrow.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to
discuss what you would like to change.

889
burrow

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
.TH BURROW 1 "06 Mar 2018" "version 1.2.6"
.TH BURROW 1 "06 Mar 2020" "version 1.7.9"
.SH NAME
burrow \- a helper for building and managing a gopher hole
.SH SYNOPSIS
@ -9,56 +9,54 @@ modification, and maintenance of a gopher hole.
.SH COMMANDS
.TP
.B phlog
Create a new phlog entry.
Prompt for the title of a new post, then open it in your default
$EDITOR.
.TP
.B recipe
Add or update a recipe to the recipe box.
.B topic
Add or update a topic in your topics directory.
.B gophermap
Open a gophermap file relative to your gopher directory for editing,
automatically stripping some special characters for easier editing of info
lines.
.TP
.B create-config
Generates a default configuration file at
.I ~/.config/burrow/config
if no other configuration file exists. It is populated with the default
settings.
.B rss
Automatically generate an RSS feed of your most recent phlog
entries and output it to the root of your gopher directory. This can be
automatically generated by using the config option config_phlog_autorss.
.TP
.B quickstart
Creates a new configuration file from interactive user prompts.
.TP
.B edit-config
Opens your burrow configuration file for editing if it exists.
.TP
.B update-git
If the gopher directory resides within a git repository, this action will do a
silent
Silently attempt to update a git repository at the location
of your gopher hole. It is appropriate for use by a cron job.
.TP
.B git-pull
which is useful for crons.
.TP
.B update-burrow
Burrow will attempt to auto-update. If the local folder where burrow is
installed is a git repository, burrow will pull the latest commit from the
remote branch. If the local directory is not a git remote, burrow will attempt
to update local files with their counterpart on the Github remote repository.
The local directory will only attempt to update files in this way which are
named
.I burrow
or some variation of that name.
.SH OPTIONS
.TP
.B -v, --version
.B -v
Display current version information.
.TP
.B -d, --debug
.B -d
Debug mode.
.TP
.B -h, --help
.TP
.B -h
Show the help.
.SH FILES
.I $XDG_CONFIG_HOME
,
.I ~/.config/burrow/config
,
,
.I ~/.config/burrow
,
,
.I ~/.burrow
,
.I /etc/burrow/config
: configuration settings for burrow. If none of these are available, the default
configuration is loaded.
.SH BUGS
None known.
.SH AUTHOR
James Tomasino <tomasino (at) sdf (dot) org>
James Tomasino <tomasino (at) lavabit (dot) com>

View File

@ -1,22 +1,46 @@
#!/usr/bin/env bash
_burrow()
{
# Get basic autocomplete commands from the function itself
local helplist
helplist=$(burrow shortlist)
# Combine all the lists for autocomplete
_burrow() {
local cur
cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $( compgen -W "$helplist" -- "$cur" ) )
if [ "${COMP_WORDS[1]}" == "gophermap" ]; then
local gopher_dir
local gophermaps
local directories
gopher_dir=$(burrow gopherdir)
search_dir=${gopher_dir}
if [ -n "${COMP_WORDS[2]}" ]; then
partial_search_dir="${gopher_dir}${COMP_WORDS[2]}"
if [ -d "$partial_search_dir" ]; then
search_dir="$partial_search_dir"
else
partial_search_dir=$(dirname "$partial_search_dir")
if [ -d "$partial_search_dir" ]; then
search_dir="$partial_search_dir"
fi
fi
fi
gophermaps=$(find "$search_dir" -mindepth 1 -maxdepth 1 -type f -name "gophermap" -print | sed "s|$gopher_dir||" | sed "s|gophermap$||" )
directories=$(find "$search_dir" -mindepth 1 -maxdepth 1 -type d -print | sed "s|$gopher_dir||" )
local suggestions=( $( compgen -W "$gophermaps $directories" -- "$cur" ) )
if [ "${#suggestions[@]}" == "1" ]; then
local resp=$(echo ${suggestions[0]/%\ */})
COMPREPLY=("$resp")
else
COMPREPLY=("${suggestions[@]}")
fi
else
local helplist
helplist=$(burrow shortlist)
COMPREPLY=( $( compgen -W "$helplist" -- "$cur" ) )
fi
}
# Detect if current shell is ZSH, and if so, load this file in bash
# compatibility mode.
if [ -n "$ZSH_VERSION" ]; then
autoload bashcompinit
bashcompinit
autoload bashcompinit
bashcompinit
fi
complete -o default -o nospace -F _burrow burrow
@ -25,5 +49,5 @@ complete -o default -o nospace -F _burrow burrow
# when the user has tab-completed the executable name and consequently
# included the '.exe' suffix.
if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
complete -o default -o nospace -F _burrow burrow.exe
complete -o default -o nospace -F _burrow burrow.exe
fi