1
0
mirror of https://github.com/gluster/glusterfs.git synced 2026-02-06 18:48:16 +01:00

6 Commits

Author SHA1 Message Date
Frédéric Moulins
064328f7dd extras: dynamic bash completion (#3751)
Move bash-completion script for the `gluster` command
in `/usr/share/bash-completion/completions`
instead of `/etc/bash_completion.d`.

Allow bash-completion to dynamically load the script
only when a user tries to tab complete on the `gluster` command.

Fixes: #3750
Change-Id: Ifca300bdf5b14a68726a6fdfdcc19052cf624f85
Signed-off-by: Frédéric Moulins <frederic@moulins.org>
2022-09-30 12:39:18 +02:00
chenglin130
9be5e5288f extras: optimize gluster command completion (#3249)
Support string elements with a function element, in parallel.
But, the function must be at the end.

fixes: #3248

Signed-off-by: Cheng Lin <cheng.lin130@zte.com.cn>
2022-07-04 12:44:19 +05:30
Ravishankar N
146b35d1ba extras, tools, doc: remove offensive language
Replace master and slave terminology in geo-replication with primary and
secondary respectively.

Change-Id: I3eb9242d2ce8340435265b764d28221d50f872c8
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2020-12-30 15:55:22 +05:30
Mark Mielke
66a11d02af Bash integration script should namespace variables
In the original submitted script, it looks like there was effort
put into namespacing all global variables. However a few mistakes
remained.

GLUSTER_TOP_SUBOPTIONSx were defined, but TOP_SUBOPTIONSx were
referenced. This was likely an unrecognized defect in the
original code submission? These are now corrected to refer to
GLUSTER_TOP_SUBOPTIONSx.

FINAL_LIST, LIST, and TOP were leaked into all Bash shells and
used by the command completion functions. The most problematic
of these was TOP, which was declared with "-i" making it an
integer. This cause other code which used TOP to define a path
to fail like this:

    $ bash
    $ TOP=/abc
    bash: /abc: syntax error: operand expected (error token is "/abc")

These are now qualified as GLUSTER_FINAL_LIST, GLUSTER_LIST, and
GLUSTER_TOP to reduce impact on scripts that might choose to use
these extremely common variable names.

Change-Id: Ic96eda8efd1f3238bbade6c6ddb69118e8d82158
Fixes: bz#1425325
Signed-off-by: Mark Mielke <mark.mielke@gmail.com>
2018-08-13 23:54:34 -04:00
Paul Stauffer
8f83bb474a bash-completion: Swap order of characters in egrep bracket expression
With glusterfs-cli installed, bash tab completion fails to work and prints an
error message:

    $ gluster volgrep: Invalid range end
    ^C

The problem is caused by the ordering of characters within an egrep bracket
expression in the "_gluster_completion()" function defined in
/etc/bash_completion.d/gluster.  The file contains this line:

    egrep -ao --color=never "([A-Za-z0-9_-.]+)|[[:space:]]+|." |  \

And egrep is interpreting the "-" character in that bracket expression as
indicating a range is being requested, "_-." Fortunately, "_" actually comes
after ".", this range expression is invalid, and egrep throws the error instead
of silently not doing what was intended.

The fix is simply to swap the positions of "-" and "." in that bracket
expression:

    egrep -ao --color=never "([A-Za-z0-9_.-]+)|[[:space:]]+|." |  \

With this change, bash tab completion works as intended.

Change-Id: Iace2d57a1122b4530987ba6f5f5558b56b094665
BUG: 1243108
Signed-off-by: Paul Stauffer <paulds@horde.com>
Reviewed-on: http://review.gluster.org/11939
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-08-17 21:00:11 -07:00
Varun Shastry
69f509b7a9 extras: bash command completion for gluster
Change-Id: Ifd6e68b0288dc65e41e467b4ad02bfc3bded341f
BUG: 1108767
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/7979
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-04 15:01:14 +05:30