aboutsummaryrefslogtreecommitdiff
path: root/man/man6
Commit message (Collapse)AuthorAgeFilesLines
* Correct type of squareTom Ryder2017-05-011-2/+4
|
* Add squ(6df)Tom Ryder2017-05-011-0/+28
|
* Add chkl(6)Tom Ryder2017-01-021-0/+32
|
* Add strik(6df)Tom Ryder2016-12-121-0/+19
|
* Add correction to aesth(6df) man pageTom Ryder2016-12-121-3/+3
|
* Add aesth(6)Tom Ryder2016-11-181-0/+19
|
* Add drakon(6df)Tom Ryder2016-10-191-0/+20
|
* Unbold arguments to rot13(6df) in manpageTom Ryder2016-09-171-1/+2
|
* Add rot13(6df)Tom Ryder2016-09-091-0/+20
|
* Update rndn(6df) manpage to reflect lost optionTom Ryder2016-09-051-3/+3
|
* Put dotfiles manuals into their own sectionTom Ryder2016-08-267-10/+10
| | | | This probably contains a few mistakes
* Add xyzzy(6)Tom Ryder2016-08-251-0/+14
|
* Improve acq(6) documentationTom Ryder2016-08-211-2/+1
|
* Add acq(6)Tom Ryder2016-08-081-0/+18
|
* Correct zs(6) example formattingTom Ryder2016-08-031-1/+2
|
* Correct kvlt(6) examplesTom Ryder2016-08-031-1/+5
|
* Add mentions to rndn(6) manual pageTom Ryder2016-08-031-1/+1
|
* Unbold arguments in rndn(6) exampleTom Ryder2016-08-031-1/+2
|
* Add dr(6)Tom Ryder2016-08-031-0/+21
| | | | Tabletop dice rolling
* Add references to rnd?(1) to rndn(6) manTom Ryder2016-08-011-0/+2
|
* Remove poetry games tinkering scriptsTom Ryder2016-07-311-18/+0
| | | | Moving these into their own suite shortly
* Clean up and document syl(6)Tom Ryder2016-07-151-0/+18
|
* Add aaf(6)Tom Ryder2016-07-041-0/+18
|
* Add seed-setting option and handlingTom Ryder2016-07-031-2/+7
|
* Add rndn(6)Tom Ryder2016-07-011-0/+19
|
* Add kvlt(6)Tom Ryder2016-06-241-0/+13
|
* Add manual page for zs(6) in new section 6Tom Ryder2016-06-241-0/+12
d color the prompt if it looks like we can if (( $({ tput colors || tput Co ; } 2>/dev/null) >= 8 )) ; then PS1='%B%F{cyan}'$PS1'%f%b' fi # Add a space and define the rest of the prompts PS1=$PS1' ' PS2='> ' PS3='? ' PS4='+<$?> $LINENO:' ;; # Revert to simple inexpensive prompts off) PS1='$ ' PS2='> ' PS3='? ' PS4='+ ' if [[ -n $SSH_CLIENT || -n $SSH_CONNECTION ]] ; then PS1=$(id -nu)'@'$(hostname -s)'$ ' fi ;; # Git prompt function git) # Wrap as compound command; we don't want to see output from any of # these git(1) calls { # Bail if we're not in a work tree--or, implicitly, if we don't # have git(1). [[ $(git rev-parse --is-inside-work-tree) == true ]] || return # Refresh index so e.g. git-diff-files(1) is accurate git update-index --refresh # Find a local branch, remote branch, or tag (annotated or # not), or failing all of that just show the short commit ID, # in that order of preference; if none of that works, bail out local name name=$( git symbolic-ref --quiet HEAD || git describe --tags --exact-match HEAD || git rev-parse --short HEAD ) || return name=${name#refs/*/} [[ -n $name ]] || return # Check various files in .git to flag processes local proc [[ -d .git/rebase-merge || -d .git/rebase-apply ]] && proc=${proc:+"$proc",}'REBASE' [[ -f .git/MERGE_HEAD ]] && proc=${proc:+"$proc",}'MERGE' [[ -f .git/CHERRY_PICK_HEAD ]] && proc=${proc:+"$proc",}'PICK' [[ -f .git/REVERT_HEAD ]] && proc=${proc:+"$proc",}'REVERT' [[ -f .git/BISECT_LOG ]] && proc=${proc:+"$proc",}'BISECT' # Collect symbols representing repository state local state # Upstream HEAD has commits after local HEAD; we're "behind" (($(git rev-list --count 'HEAD..@{u}'))) && state=${state}'<' # Local HEAD has commits after upstream HEAD; we're "ahead" (($(git rev-list --count '@{u}..HEAD'))) && state=${state}'>' # Tracked files are modified git diff-files --no-ext-diff --quiet || state=${state}'!' # Changes are staged git diff-index --cached --no-ext-diff --quiet HEAD || state=${state}'+' # There are some untracked and unignored files git ls-files --directory --error-unmatch --exclude-standard \ --no-empty-directory --others -- ':/*' && state=${state}'?' # There are stashed changes git rev-parse --quiet --verify refs/stash && state=${state}'^' } >/dev/null 2>&1 # Print the status in brackets; add a git: prefix only if there # might be another VCS prompt (because PROMPT_VCS is set) printf '(%s%s%s%s)' \ "${PROMPT_VCS:+git:}" "$name" "${proc:+:"$proc"}" "$state" ;; # Subversion prompt function svn) # Determine the repository URL and root directory local key value url root while [[ -z $url || -z $root ]] && IFS=: read -r key value ; do case $key in 'URL') url=${value## } ;; 'Repository Root') root=${value## } ;; esac done < <(svn info 2>/dev/null) # Exit if we couldn't get either--or, implicitly, if we don't have # svn(1). [[ -n $url && -n $root ]] || return # Remove the root from the URL to get what's hopefully the branch # name, removing leading slashes and the 'branches' prefix, and any # trailing content after a slash local branch branch=${url/"$root"} branch=${branch#/} branch=${branch#branches/} branch=${branch%%/*} # Parse the output of svn status to determine working copy state local symbol local -i modified untracked while ((!modified || !untracked)) && read -r symbol _ ; do case $symbol in *\?*) untracked=1 ;; *) modified=1 ;; esac done < <(svn status 2>/dev/null) # Add appropriate state flags local state ((modified)) && state=${state}'!' ((untracked)) && state=${state}'?' # Print the state in brackets with an svn: prefix printf '(svn:%s%s)' "${branch:-unknown}" "$state" ;; # VCS wrapper prompt function; print the first relevant prompt, if any vcs) local vcs for vcs in "${PROMPT_VCS[@]:-git}" ; do prompt "$vcs" && return done ;; # Show return status of previous command in angle brackets, if not zero ret) # shellcheck disable=SC2154 ((ret)) && printf '<%u>' "$ret" ;; # Show the count of background jobs in curly brackets, if not zero job) local -i jobc while read -r ; do ((jobc++)) done < <(jobs -p) ((jobc)) && printf '{%u}' "$jobc" ;; # No argument given, print prompt strings and vars '') declare -p PS1 PS2 PS3 PS4 ;; # Print error *) printf 'prompt: Unknown command %s\n' "$1" >&2 return 2 ;; esac } # Default to a full-featured prompt, but use PROMPT_MODE if that's set prompt "${PROMPT_MODE:-on}"