Remove dependency on click-default-group package #903
Merged
+98
−166
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inheriting
DefaultGroup
class from click-default-group package breaks autocomplete, so we remove dependence upon it.Fixes #27
In doing so, a couple commands changed:
Previously,
sonic-clear ip bgp
would, by default, clear all bgp data for all neighbors. This functionality was already being duplicated if someone ransonic-clear ip bgp neighbor
without specifying a peer IP address. Thus, I instead added an 'all' subcommand tosonic-clear ip bgp neighbor
(and also added a matching 'all' subcommand to the 'soft' groupsonic-clear ip bgp soft
), restructuring thesonic-clear ip bgp
commands as follows:sonic-clear ip bgp neighbor all [<ipaddress>]
sonic-clear ip bgp neighbor in [<ipaddress>]
sonic-clear ip bgp neighbor out [<ipaddress>]
sonic-clear ip bgp neighbor soft all [<ipaddress>]
sonic-clear ip bgp neighbor soft in [<ipaddress>]
sonic-clear ip bgp neighbor soft out [<ipaddress>]
I think we could further consolidate these functions in the future by adding
soft
as an option (e.g., a-s|--soft
flag?) to the first threesonic-clear ip bgp neighbor
commands instead of making it its own subgroup of commands (opened issue [clear] Consolidate 'soft' variants of bgp neighbor clear commands #906).I also think we should consider removing the
undebug
utility, and instead add anon|off
parameter to all commands in thedebug
utility, thus consolidating further (opened issue Consider removing 'undebug' utility and consolidate functinality into 'debug' utility #905).Also corrected some docstrings