-
Notifications
You must be signed in to change notification settings - Fork 4
/
prwd.1
81 lines (81 loc) · 2.76 KB
/
prwd.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.\" Copyright (c) 2009-2015 Bertrand Janin <b@janin.com>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: May 9 2013 $
.Dt PRWD 1
.Os
.Sh NAME
.Nm prwd
.Nd universal shell prompt
.Sh SYNOPSIS
.Nm prwd
.Op Fl aVh
.Sh DESCRIPTION
.Nm
is a replacement for your shell's PS1, it provides a simple templating language
with commands to customize your prompt.
.Nm
keeps your prompt consistent between shells, provides fast template commands to
display contextual information such as hostname, path, current git/hg branch
without an inordinate amount of slow shell scripting.
.Pp
The command-line options are as follows:
.Bl -tag -width Ds
.It Fl V
Show current version.
.It Fl h
Show usage.
.It Fl t Ar template
Use the provided template instead of the one defined in the configuration file
or the one defined in the environment variable PRWD. This is particularly useful
for testing a new template. Use single quote (') around your template to avoid
your shell to expand the $ variable.
.It Fl a
Outputs all the aliases starting with '$' as shell variable exports. The output
from this command is meant to be used with eval in your .profile file, see
section ALIAS VARIABLES in the
.Xr prwdrc 5
manual for more detailed information.
.El
.Sh ENVIRONMENT
.Nm
can read its template from a configuration file, a command-line parameters or the
following environment variable:
.Bl -tag -width REMOTEHOST
.It Ev PRWD
The template used to render your prompt. This value will override the default
internal template and can be overridden by the configuration file.
.El
.Sh FILES
.Bl -tag -width ~/.prwdrc -compact
.It Pa ~/.prwdrc
defines all the configuration, overrides PRWD and the internal defaults. See
.Xr prwdrc 5
for configuratiom syntax and parameters.
.El
.Sh SETUP
You'll need to place this line in your ~/.profile (your mileage may vary):
.Bd -literal -offset indent
export PS1='`prwd`'
.Ed
.Sh SEE ALSO
.Xr prwdrc 5 ,
.Xr pwd 1 ,
.Xr csh 1 ,
.Xr ksh 1 ,
.Xr sh 1 ,
.Xr getcwd 3
.Sh AUTHORS
prwd was written by Bertrand Janin <b@janin.com> and is distributed under an
ISC license (BSD compatible, OSI compatible).