mkdir_heute - create and find directories interactive
mkdir_heute mkdir_heute --basedir=~/archive mkdir_heute --listlines=15 --columns=80
This documentation refers to version v1.0.2.
This script scans a basedir (~/A) for directories named YYYY/MM/DD where YYYY, MM and DD are numbers corresponding to a year, month, day of month and prints them on STDERR.
The script returns the choosen directory on STDOUT and may be used in a shell alias like this:
alias cdheute='cd `mkdir_heute`'
so that you may say 'cdheute' on the command line and your working directory will be changed to the choosen directory.
When invoked you may
choose a directory from the list with it's number
choose the current directory with 'q' or '.'
advance to the next or last page with 'n' or 'l'
return to the previous or first page with 'p' or 'f'
constrain the shown directories with '/' and a pattern
constrain the creation date of the directories with 'd' followed by '=', '<' or '>' and a date (eg. 2009, 2009-04 or 2009-04-24)
create a new directory with '+' followed by a description for it
With this argument it is possible to redirect the script to another base directory under which it scans for project descriptions to display. A new directory would be created below this directory.
mkdir_heute --basedir=~/archive mkdir_heute -b ~/archive
Limit the displaywidth to the given number of columns.
mkdir_heute --columns=80 mkdir_heute -c 80
Limit the number of listed lines. This should be 4 lines less than your screen provides.
mkdir_heute --listlines=21 mkdir_heute -l 15
The size of the screen is determined by Term::ReadKey::GetTerminalSize(). If your system has no functioning module Term::ReadKey, you can switch this off and the programs defaults to 80 columns and 21 listlines. Off course you set other limits with -c or -l instead.
Term::ReadKey::GetTerminalSize()
-c
-l
Usually
This happened to me especially on elder systems when invoked via backtics such as
cd `mkdir_heute`
although the program works fine when invoked directly.
One workaround is to install the program resize which comes on Debian GNU Linux within the package xutils.
If you can't install the program resize, you could disable Term::ReadKey at program startup like this
cd `mkdir_heute --notermreadkey`
Mathias Weidner
Copyright (c) 2009-2018 Mathias Weidner (mamawe@cpan.org). All rights reserved.
This module is free software; you can redistribute and/or modify it under the same terms as Perl itself. See perlartistic.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Directory::Organize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Directory::Organize
CPAN shell
perl -MCPAN -e shell install Directory::Organize
For more information on module installation, please visit the detailed CPAN module installation guide.