bug-global
[Top][All Lists]
Advanced

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

[RFC] New mechanism for specifying options


From: Shigio YAMAGUCHI
Subject: [RFC] New mechanism for specifying options
Date: Thu, 27 Mar 2014 12:29:04 +0900

Hi all,
I propose new useful mechanism for specifying options.
These most are jason's idea.

1. Tree Environment variables 

Environment variable    Target command
--------------------------------------
GLOBAL_OPTIONS          global
GTAGS_OPTIONS           gtags
HTAGS_OPTIONS           htags
--------------------------------------

Offering three environment variables which define individual
default options for global(1), gtags(1) and htags(1),
respectively.

The value of each variable is inserted at the head of
the command options. For example, when GLOBAL_OPTIONS
is set to '--color=always --through', 'global -x main'
is executed as 'global --color=always --through -x main'.

Since priority is given to options specified later,
you can overwrite the default options.

$ export GLOBAL_OPTIONS=--result=ctags-x
$ global main --result=grep     # print grep format

2. Three options

New options             options overwritten
---------------------------------------------
-E (--extended-regexp)  -G (--basic-regexp)
-N (--project)          -T (--through)
-m (--match-case)       -i (--ignore-case)

Adding three options for specifying the system default
of global(1). They are convenient to use the environment
variables described in 1.

If GLOBAL_OPTIONS is set to '--ignore-case', then
global command works like follows:

$ global -x main        # case in-sensitive search
$ global -x main -m     # case sensitive search

3. Three configuration variables

Adding three configuration variables of the same name
as the environment variables described in 1.

Example:
[gtags.conf]
        :GLOBAL_OPTIONS=--ignore-case:\
        :GTAGS_OPTIONSS=--idutils:\
        :HTAGS_OPTIONS=-gs:...


Each environment variable is given more priority than configuration
variable of the same name. 'htags_options' will be deprecated.

This rule should be applied to any environment variable used in GLOBAL
someday, I think.

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]