Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 19 lines (12 sloc) 0.367 kb
80fda6b @toolbear added several
authored
1 #!/usr/bin/env perl
2
3 use strict; use warnings; use utf8;
4
5 use Cwd();
6
7 my $MAX = $ARGV[0] || 77;
8
80ad58e @toolbear in PS1 prompt handle when cwd has been removed
authored
9 my $dir = Cwd::getcwd() || "you are on a grey featureless plane (formerly $ENV{PWD})";
80fda6b @toolbear added several
authored
10 $dir =~ s/$ENV{HOME}/~/;
11 if (length($dir) > $MAX) {
12 my $left = index($dir, "/") + 1;
13 $dir = substr($dir, 0, $left) . "..." . substr($dir, -($MAX - $left));
14 }
15
16 print $dir;
17
18 1;
Something went wrong with that request. Please try again.