bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC] A project basis configuration mechanism


From: Shigio YAMAGUCHI
Subject: [RFC] A project basis configuration mechanism
Date: Mon, 31 Mar 2014 15:51:24 +0900

Hi all,
I propose a project basis configuration mechanism.
This is based on Leo's idea.

1. Project basis configuration file

1.1 gtags.conf

You can use 'gtags.conf' file per project. File name
should be always 'gtags.conf', and should be put on
the root directory of each project.

For example,
$ vi gtags.conf
$ gtags
$ global -x main

is equal to 

$ vi gtags.conf
$ export GTAGSCONF=`pwd`/gtags.conf
$ gtags
$ global -x main

1.2 gtags.label

Additionally, you can use 'gtags.label' file to specify
a label of configuration files. The contents of the file
is used as a label name. By using it, you can collect
various definitions in one file. For example, 

[$HOME/.globalrc]
+-------------------------
|default:...
|perlproj:...       <= definitions for perl projects
|phpproj:...        <= definitions for php projects

(in a perl project)
$ echo 'perlproj' >gtags.label
$ gtags

is equal to 

$ GTAGSLABEL=perlproj gtags

1.3 Independency

The two above-mentioned files are available separately
or together.

2. Priority

1.2 gtags.conf

Priority to select a configuration file is like follows:
(Lower number means higher priority)

Priority Configuration file
------------------------------------------------------
1 $GTAGSCONF
2 <project root>/gtags.conf <= NEW
3 $HOME/.globalrc
4 /etc/gtags.conf
5 /usr/local/etc/gtags.conf
default (do not use configuration file)

The point is that project basis gtags.conf is given higher
priority than $HOME/.globalrc. It realizes the followings.

o You can write your default configuration in $HOME/.globalrc.
o If you need individual configuration per project, then you
  can write 'gtags.conf' file for each project.

2.2 gtags.label

Priority to select a configuration label is like follows:
(Lower number means higher priority)

Priority Label
------------------------------------------------------
1 $GTAGSLABEL
2 contents of <project root>/gtags.label     <= NEW
default 'default'

Any comment?
--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

reply via email to

[Prev in Thread] Current Thread [Next in Thread]