MCPcopy Create free account
hub / github.com/dotzero/git-profile / unuseCommand

Function unuseCommand

cmd/unuse.go:17–40  ·  view source on GitHub ↗
(cfg storage, v vcs)

Source from the content-addressed store, hash-verified

15}
16
17func unuseCommand(cfg storage, v vcs) *cobra.Command {
18 return &cobra.Command{
19 Use: "unuse [profile]",
20 Aliases: []string{"uu"},
21 Short: "Unuse a profile",
22 Long: "Removes the applied profile entries from the current git repository.",
23 Example: multiline(
24 `git-profile unuse`,
25 `git-profile unuse my-profile`,
26 ),
27 PreRun: func(cmd *cobra.Command, _ []string) {
28 check(cmd, cfg, v)
29 },
30 Run: func(cmd *cobra.Command, args []string) {
31 profile, err := unuseProfileResolve(args, v)
32 if err != nil {
33 ui.PrintErrln(cmd, ui.ErrorStyle, "%s", err)
34 os.Exit(0)
35 }
36
37 profileUnapply(cmd, cfg, v, profile)
38 },
39 }
40}
41
42func unuseProfileResolve(args []string, v vcs) (string, error) {
43 if len(args) > 0 {

Callers 1

UnuseFunction · 0.85

Calls 5

PrintErrlnFunction · 0.92
multilineFunction · 0.85
checkFunction · 0.85
unuseProfileResolveFunction · 0.85
profileUnapplyFunction · 0.85

Tested by

no test coverage detected