-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1537 from BishopFox/v1.6.0/cli-changes
Fix CLI changes
- Loading branch information
Showing
255 changed files
with
5,686 additions
and
5,301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ import ( | |
"sort" | ||
|
||
"github.com/bishopfox/sliver/client/assets" | ||
|
||
"gopkg.in/AlecAivazis/survey.v1" | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package alias | ||
|
||
import ( | ||
"github.com/bishopfox/sliver/client/command/flags" | ||
"github.com/bishopfox/sliver/client/command/help" | ||
"github.com/bishopfox/sliver/client/console" | ||
consts "github.com/bishopfox/sliver/client/constants" | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// Commands returns the `alias` command and its child commands. | ||
func Commands(con *console.SliverClient) []*cobra.Command { | ||
aliasCmd := &cobra.Command{ | ||
Use: consts.AliasesStr, | ||
Short: "List current aliases", | ||
Long: help.GetHelpFor([]string{consts.AliasesStr}), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
AliasesCmd(cmd, con, args) | ||
}, | ||
GroupID: consts.GenericHelpGroup, | ||
} | ||
|
||
aliasLoadCmd := &cobra.Command{ | ||
Use: consts.LoadStr + " [ALIAS]", | ||
Short: "Load a command alias", | ||
Long: help.GetHelpFor([]string{consts.AliasesStr, consts.LoadStr}), | ||
Args: cobra.ExactArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
AliasesLoadCmd(cmd, con, args) | ||
}, | ||
} | ||
aliasCmd.AddCommand(aliasLoadCmd) | ||
flags.NewCompletions(aliasLoadCmd).PositionalCompletion(carapace.ActionDirectories().Tag("alias directory").Usage("path to the alias directory")) | ||
|
||
aliasInstallCmd := &cobra.Command{ | ||
Use: consts.InstallStr + " [ALIAS]", | ||
Short: "Install a command alias", | ||
Long: help.GetHelpFor([]string{consts.AliasesStr, consts.InstallStr}), | ||
Args: cobra.ExactArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
AliasesInstallCmd(cmd, con, args) | ||
}, | ||
} | ||
aliasCmd.AddCommand(aliasInstallCmd) | ||
flags.NewCompletions(aliasInstallCmd).PositionalCompletion(carapace.ActionFiles().Tag("alias file")) | ||
|
||
aliasRemove := &cobra.Command{ | ||
Use: consts.RmStr + " [ALIAS]", | ||
Short: "Remove an alias", | ||
Long: help.GetHelpFor([]string{consts.RmStr}), | ||
Args: cobra.ExactArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
AliasesRemoveCmd(cmd, con, args) | ||
}, | ||
} | ||
flags.NewCompletions(aliasRemove).PositionalCompletion(AliasCompleter()) | ||
aliasCmd.AddCommand(aliasRemove) | ||
|
||
return []*cobra.Command{aliasCmd} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.