-
-
Notifications
You must be signed in to change notification settings - Fork 11
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 #5 from rsteube/break-all-the-things
added injection command
- Loading branch information
Showing
6 changed files
with
160 additions
and
27 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
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,27 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var injectionCmd = &cobra.Command{ | ||
Use: "injection", | ||
Short: "just trying to break things", | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(injectionCmd) | ||
|
||
carapace.Gen(injectionCmd).PositionalCompletion( | ||
carapace.ActionValues("$(echo fail)"), | ||
carapace.ActionValues(`\$(echo fail)`), | ||
carapace.ActionValues("`echo fail`"), | ||
carapace.ActionValues(`"; echo fail #`), | ||
carapace.ActionValues(`"| echo fail #`), | ||
carapace.ActionValues(`"&& echo fail #`), | ||
carapace.ActionValues(`\$(echo fail)`), | ||
carapace.ActionValues(`\`), | ||
carapace.ActionValues(`LAST POSITIONAL VALUE`), | ||
) | ||
} |
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