Skip to content

Commit

Permalink
✨ Profile internal functions implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
julien040 committed Dec 24, 2022
1 parent 264aa78 commit ef6f513
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 13 deletions.
83 changes: 83 additions & 0 deletions cmd/profile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
Copyright © 2022 Julien CAGNIART
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

// profileCmd represents the profile command
var profileCmd = &cobra.Command{
Use: "profile",
Short: "Manage your profiles",

Run: func(cmd *cobra.Command, args []string) {
fmt.Println("profile called")
},
}

var profileAddCmd = &cobra.Command{
Use: "add",
Short: "Add a new profile",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("profile add called")
},
Args: cobra.ExactArgs(3),
Aliases: []string{"a", "new"},
}

var profileRemoveCmd = &cobra.Command{
Use: "remove [profile name]",
Short: "Remove a profile",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("profile remove called")
},
Aliases: []string{"rm"},
}

var profileListCmd = &cobra.Command{
Use: "list",
Short: "List all your profiles",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("profile list called")
},
Aliases: []string{"ls"},
}

func init() {
rootCmd.AddCommand(profileCmd)
profileCmd.AddCommand(profileAddCmd)
profileCmd.AddCommand(profileRemoveCmd)
profileCmd.AddCommand(profileListCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// profileCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// profileCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
24 changes: 21 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,51 @@ module github.com/julien040/gut
go 1.19

require (
github.com/briandowns/spinner v1.19.0
github.com/99designs/keyring v1.2.2
github.com/fatih/color v1.13.0
github.com/go-git/go-git/v5 v5.5.1
github.com/gookit/config/v2 v2.1.8
github.com/matoous/go-nanoid/v2 v2.0.0
github.com/spf13/cobra v1.6.1
)

require (
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/manifoldco/promptui v0.9.0
)

require (
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/cloudflare/circl v1.1.0 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gookit/goutil v0.5.15 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/pjbgf/sha1cd v0.2.3 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/text v0.4.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
Loading

0 comments on commit ef6f513

Please sign in to comment.