Changeset 8135737


Ignore:
Timestamp:
Jan 23, 2012, 5:12:56 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.9
Children:
9a2dd0c, ab88b05, 533b3a4
Parents:
678f607
git-author:
Kevin Riggle <kevinr@free-dissociation.com> (12/26/11 17:35:51)
git-committer:
David Benjamin <davidben@mit.edu> (01/23/12 17:12:56)
Message:
rename default config file to .owl/init.pl

motivations: to make clear that the config file is a perl script, which
runs before and is neither shadowed nor superceded by .owl/startup.

fix doc wording per andersk

more doc fixes from andersk

clean up the else-case logic, per andersk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/barnowl.1

    rbad4496 r8135737  
    3535.TP
    3636\fB\-c\fP, \fB\-\-config\-file\fP=\fIFILE\fP
    37 Specify an alternate config file for \fBBarnOwl\fP to use.  By default,
    38 \fBBarnOwl\fP uses \fI~/.barnowlconf\fP if it exists, and \fI~/.owlconf\fP otherwise.
     37Specify an alternate config file for \fBBarnOwl\fP to use.  The config file is
     38an arbitrary Perl script evaluated in the \fImain\fP package, and if it
     39overrides the \fIBarnOwl::startup\fP method that is run when \fBBarnOwl\fP
     40starts.  (Compare \fI~/.owl/startup\fP, which contains \fBBarnOwl\fP commands
     41that are run at startup after the config file is loaded.)
     42
     43By default, \fBBarnOwl\fP uses the first of \fI~/.owl/init.pl\fP,
     44\fI~/.barnowlconf\fP, or \fI~/.owlconf\fP that exists.
    3945
    4046.TP
  • owl.c

    r389d487 r8135737  
    4141  fprintf(stderr, "  -v,--version        print the Barnowl version number and exit\n");
    4242  fprintf(stderr, "  -h,--help           print this help message\n");
    43   fprintf(stderr, "  -c,--config-file    specify an alternate config file\n");
    4443  fprintf(stderr, "  -s,--config-dir     specify an alternate config dir (default ~/.owl)\n");
     44  fprintf(stderr, "  -c,--config-file    specify an alternate config file (default ~/.owl/init.pl)\n");
    4545  fprintf(stderr, "  -t,--tty            set the tty name\n");
    4646}
  • perl/lib/BarnOwl.pm

    r7803326 r8135737  
    329329our @all_commands;
    330330
    331 if(!$configfile && -f $ENV{HOME} . "/.barnowlconf") {
    332     $configfile = $ENV{HOME} . "/.barnowlconf";
    333 }
    334 $configfile ||= $ENV{HOME}."/.owlconf";
     331if(!$configfile) {
     332    if (-f get_config_dir() . "/init.pl") {
     333        $configfile = get_config_dir() . "/init.pl";
     334    } elsif (-f $ENV{HOME} . "/.barnowlconf") {
     335        $configfile = $ENV{HOME} . "/.barnowlconf";
     336    } else {
     337        $configfile = $ENV{HOME}."/.owlconf";
     338    }
     339}
    335340
    336341# populate global variable space for legacy owlconf files
Note: See TracChangeset for help on using the changeset viewer.