File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
completers/ip_completer/cmd Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ package action
2+
3+ import "github.com/rsteube/carapace"
4+
5+ func ActionConfFlags () carapace.Action {
6+ return carapace .ActionValuesDescribed (
7+ "home" , "(IPv6 only) designates this address the \" home address\" " ,
8+ "nodad" , "(IPv6 only) do not perform Duplicate Address Detection" ,
9+ "mngtmpaddr" , "(IPv6 only) make the kernel manage temporary addresses created from this one as template" ,
10+ "noprefixroute" , "Do not automatically create a route for the network prefix of the added address" ,
11+ "autojoin" , "enable autojoin" ,
12+ )
13+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package cmd
22
33import (
44 "github.com/rsteube/carapace"
5+ "github.com/rsteube/carapace-bin/completers/ip_completer/cmd/action"
56 "github.com/rsteube/carapace-bin/pkg/actions/net"
67 "github.com/spf13/cobra"
78)
@@ -22,4 +23,10 @@ func init() {
2223 carapace .ActionValues ("dev" ),
2324 net .ActionDevices (net.IncludedDevices {Wifi : true , Ethernet : true }),
2425 )
26+
27+ carapace .Gen (address_addCmd ).PositionalAnyCompletion (
28+ carapace .ActionCallback (func (c carapace.Context ) carapace.Action {
29+ return action .ActionConfFlags ().Invoke (c ).Filter (c .Args [2 :]).ToA ()
30+ }),
31+ )
2532}
You can’t perform that action at this time.
0 commit comments