bug-global
[Top][All Lists]
Advanced

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

Re: [RFC] New mechanism for specifying options


From: Shigio YAMAGUCHI
Subject: Re: [RFC] New mechanism for specifying options
Date: Mon, 21 Apr 2014 09:52:43 +0900

I would like to change the RFC as follows.

1. Addition of -U option

The default options are used only when -U (--use-default)
option is specified. It is provided for the each command.

$ global -x main                # without default options
$ global -xU main               # use default options

The reason is for preventing bad influences to applications
which use GLOBAL. For example, if GLOBAL_OPTIONS is set to '-G'
then the following command will fail.

global "<extended regular _expression_>" ...

Since there are many tools which use GLOBAL, we should not add
changes which break what are working now.

2. Change of option names

* -N (--project) -> -F (--first-match)

  Because this option is not limited to a project.

* -m (--match-case) -> -M (--match-case)

  The reason is for reservation of -m option for another use.
  A small letter option is already precious resource.

3. Deprecated configuration variables

These will be removed in the future.

deprecated      substitute
-------------------------------------
htags_options   HTAGS_OPTIONS
ncol            -n, --line-number [columns]
tabs            --tabs cols
-------------------------------------

An example of rewriting method:

[gtags.conf]
:htags_options=-v:ncol#4:tabs#8:
=> :HTAGS_OPTIONS=-v --line-number=4 --tabs=8:

Any comment?



2014-03-27 12:29 GMT+09:00 Shigio YAMAGUCHI <address@hidden>:
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



--
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]