Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vbash: beautify tab completion output/line breaks #1366

Merged
merged 2 commits into from
Jun 21, 2022

Conversation

c-po
Copy link
Member

@c-po c-po commented Jun 20, 2022

Change Summary

Commit a6f82bb ("T1748: vbash: beautify tab completion output/line breaks")
added a method to split the help string and insert newlines and leading tabs
in a deterministic way.

This commit cleans up the legacy implementations where leading whitespaces got
counted and added by humans in a try/error method.

Change from

cpo@LR2.wue3# set service dhcp-server
Possible completions:
   disable      Temporary disable
   dynamic-dns-update
                Dynamically update Domain Name System (RFC4702)
 > failover     DHCP failover configuration
+  global-parameters
                Additional global parameters for DHCP server. You must
                use the syntax of dhcpd.conf in this text-field. Using this
                without proper knowledge may result in a crashed DHCP server.
                Check system log to look for errors.
   host-decl-name
                Use host declaration name for forward DNS name
   hostfile-update
                Updating /etc/hosts file (per client lease)
+  listen-address
                Local IPv4 addresses for service to listen on
+> shared-network-name
                Name of DHCP shared network

to

cpo@LR1.wue3# set service dhcp-server
Possible completions:
   disable              Disable instance
   dynamic-dns-update   Dynamically update Domain Name System (RFC4702)
 > failover             DHCP failover configuration
+  global-parameters    Additional global parameters for DHCP server. You must use the
                        syntax of dhcpd.conf in this text-field. Using this without
                        proper knowledge may result in a crashed DHCP server. Check
                        system log to look for errors.
   host-decl-name       Use host declaration name for forward DNS name
   hostfile-update      Updating /etc/hosts file (per client lease)
+  listen-address       Local IPv4 addresses to listen on
+> shared-network-name  Name of DHCP shared network

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

bash

Proposed changes

How to test

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

c-po added 2 commits June 20, 2022 21:37
Indention for multi-line help strings should be auto calculated and not be a
human problem. This way we ensure that there is a consistent CLI with
predictable newlines at a predictable position.
…line

Commit a6f82bb ("T1748: vbash: beautify tab completion output/line breaks")
added a method to split the help string and insert newlines and leading tabs
in a deterministic way.

This commit cleans up the legacy implementations where leading whitespaces got
counted and added by humans in a try/error method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants