Skip to content

Commit

Permalink
add --hidden flag to resto install command, update options mod
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Dec 25, 2021
1 parent 9d017f0 commit 5e6668d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion cli/install/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
func InstallCMD() *cobra.Command {
opts := options.InstallCommandOptions{
Shell: "",
IsHidden: false,
URL: "",
}

Expand Down Expand Up @@ -50,6 +51,7 @@ func InstallCMD() *cobra.Command {
}

cmd.Flags().StringVarP(&opts.Shell, "shell", "s", "", "shell to use (Default: " + p + ")")
cmd.Flags().BoolVarP(&opts.IsHidden, "hidden", "H", false, "hide the output")

return cmd
}
Expand Down Expand Up @@ -94,7 +96,9 @@ func runInstall(opts *options.InstallCommandOptions) error {

s.Stop()

fmt.Print("\n\n" + out)
if !opts.IsHidden {
fmt.Println(out)
}

return nil
}
5 changes: 3 additions & 2 deletions core/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ type CLIOptions struct {
}

type InstallCommandOptions struct {
Shell string
URL string
Shell string
IsHidden bool
URL string
}

type RunCommandOptions struct {
Expand Down

0 comments on commit 5e6668d

Please sign in to comment.