aboutsummaryrefslogtreecommitdiffstats
path: root/bosun (follow)
Commit message (Collapse)AuthorAgeLines
* Add aliases for the `remove` commandWynn Wolf Arbor2020-05-13-1/+1
| | | | | | | Even if the user is familiar with bosun(1), they might try to remove a role by invoking it with `delete` or `del` instead of `remove`. As these are very common synonyms, add a simple DWIM mechanic to enhance the user experience.
* Improve error reportingWynn Wolf Arbor2020-05-13-4/+31
| | | | | | | | | | | | This commit introduces several improvements to the way bosun reacts to and reports errors. Instead of doing nothing and exiting silently, alert the user and print a short usage synopsis if bosun does not understand a command it was passed. Also, alert the user and print available list types if the `list` command was invoked with a type it does not understand. Lastly, check for the existence of a role before trying to `add`, `remove`, or `rebuild` it.
* Simplify handling of default actionsWynn Wolf Arbor2020-05-13-4/+2
| | | | | | | Instead of using a catchall pattern for `case`, assign a default value to the variable in question. This helps reduce the amount of special cases - especially considering the addition of better error reporting in an upcoming commit.
* Only shift positional parameters if there are anyWynn Wolf Arbor2020-05-13-2/+1
| | | | | | | | | | | | | | bash 5.0 now enables its 'shift_verbose' option in POSIX mode by default, printing an error message if there's not enough positional arguments for the `shift` builtin. We rely on the previous (silent) behaviour in two places. For main command parsing, introduce an explicit check before invoking `shift` to make sure it is only called if there are enough positional arguments. The call to `shift` in the list() method is actually superfluous, as no more than one positional argument is ever referenced; we drop it fully there.
* Make list_active more robustWynn Wolf Arbor2020-01-21-5/+6
| | | | | | | | | | | | | | | | | | A couple of small changes to this function should make it more robust in the long run: 1) We no longer filter the symlinks with find(1), instead combining filtering and substituting in sed(1) 2) We use the absolute path (as given by readlink -f) such that we can anchor the regular expression pattern to avoid unwanted substitution. 3) Instead of hard-coding paths we now use STOW_DIR (and STOW_DIR/.. for the target directory) 4) To avoid unnecessary complexity, we no longer let the user override STOW_DIR. This tool is supposed to be used with the canonical /etc/portage/stow location
* Have rebuild accept one or more rolesWynn Wolf Arbor2020-01-20-2/+6
| | | | | This lets the user rebuild (or restow) specific roles and will fix a certain issue with stow refusing to unstow everything.
* Make shellcheck happyWynn Wolf Arbor2020-01-20-1/+1
| | | | | I would not expect this to ever fail, but quoting the specific invocation of id -u here silences the only shellcheck warning.
* Simplify invocation of stowWynn Wolf Arbor2020-01-20-8/+6
| | | | | | | Instead of hard-coding the stow invocation (which also had a quoting issue), just export the STOW_DIR environment variable which stow uses already. TARGET can be dropped because it is implicitly defined to be the parent directory of STOW_DIR.
* Rename to "bosun"1.0.0Wolfgang Müller2019-06-19-0/+74