ClusterLabs / crmsh

Command-line interface for High-Availability cluster management on GNU/Linux systems.
GNU General Public License v2.0
131 stars 94 forks source link

`crm configure property` bash completion and the help text for each property #1390

Open zzhou1 opened 6 months ago

zzhou1 commented 6 months ago

Few more findings:

  1. Can we provide bash completion for crm configure property <TAB><TAB>? Just like the interactive mode which is very good.

  2. Similar, to provide meta-data description completion, for example, crm configure property stonith-timeout= <TAB><TAB>

  3. crm configure property --help could be revised accordingly to use the above approach instead of referring to crm ra info

Originally posted by @liangxin1300 in https://github.com/ClusterLabs/crmsh/issues/1379#issuecomment-2058172211

liangxin1300 commented 6 months ago

2. Similar, to provide meta-data description completion, for example, crm configure property stonith-timeout= <TAB><TAB>

Should be impossible to show the description at non-interactive mode

Like

# crm configure property dc-deadtime=
dc-deadtime (time, [20s]): How long to wait for a response from other nodes during start-up
    The optimal value will depend on the speed and load of your network and the type of switches used.

The cursor will be positioned after the string

At interactive mode, the description will be shown in a loop

crm(live/15sp5-2)configure# property dc-deadtime=
dc-deadtime (time, [20s]): How long to wait for a response from other nodes during start-up
    The optimal value will depend on the speed and load of your network and the type of switches used.

crm(live/15sp5-2)configure# property dc-deadtime=

That's why we wrote this condition https://github.com/ClusterLabs/crmsh/blob/master/crmsh/ui_configure.py#L228

liangxin1300 commented 6 months ago

I'm inclined to show help info for that property after the command failed, instead to show help info with

alp-1:~ # crm configure property no-quorum-policy=
ERROR: syntax in property: Empty value for no-quorum-policy is not allowed parsing 'property no-quorum-policy='
# Add help info here for no-quorum-policy

alp-1:~ # crm configure property no-quorum-policy
ERROR: syntax in property: Unknown arguments: no-quorum-policy near <no-quorum-policy> parsing 'property no-quorum-policy'
# Add help info here for no-quorum-policy