Skip to content

Commit

Permalink
fix: search command
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Feb 7, 2025
1 parent 7a01328 commit 10210e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/lib/cc/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ func Emp3r0rCommands(app *console.Console) console.Commands {
GroupID: "module",
Short: "Search for a module",
Example: "search shell",
Args: cobra.ExactArgs(1),
Run: ModuleSearch,
}
searchCmd.Flags().StringP("keyword", "q", "", "Keyword to search")
rootCmd.AddCommand(searchCmd)

lsPortMapppingsCmd := &cobra.Command{
Expand Down
10 changes: 1 addition & 9 deletions core/lib/cc/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,7 @@ func ValidateActiveTarget() (target *emp3r0r_def.Emp3r0rAgent) {

// search modules, powered by fuzzysearch
func ModuleSearch(cmd *cobra.Command, args []string) {
keyword, err := cmd.Flags().GetString("keyword")
if err != nil {
LogError("ModuleSearch: %v", err)
return
}
if keyword == "" {
LogError("ModuleSearch: no keyword provided")
return
}
keyword := args[0]
search_targets := new([]string)
for name, comment := range ModuleNames {
*search_targets = append(*search_targets, fmt.Sprintf("%s: %s", name, comment))
Expand Down

0 comments on commit 10210e0

Please sign in to comment.