Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMMENTS ADD #45

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion cli/commands/login/command.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
//Comments add:

/*
Overall, this code defines a "login" CLI command
that allows users to manage login profiles. It handles options,
internationalization, profile creation, and profile selection based
on user input and flags. The specific behavior of some functions (e.g., New and Select)
is not provided in this code snippet, so their exact functionality would
depend on their implementations in other parts of the codebase.
package login
*/

import (
/* IMPORT
The code starts by importing various packages and modules,
including packages related to CLI handling, flags, internationalization
(i18n), login functionality, prompts, and utility functions for string slices.
*/
import (
"github.com/taubyte/tau-cli/cli/common/options"
"github.com/taubyte/tau-cli/flags"
loginFlags "github.com/taubyte/tau-cli/flags/login"
Expand All @@ -13,6 +28,11 @@ import (
"github.com/urfave/cli/v2"
)

/* VAR
var Command Declaration: The code defines a variable named Command,
which is a pointer to a cli.Command struct. This struct represents
the definition of a CLI command.
*/
var Command = &cli.Command{
Name: "login",
Flags: flags.Combine(
Expand All @@ -27,6 +47,7 @@ var Command = &cli.Command{
Before: options.SetNameAsArgs0,
}

//Run Function: This function, Run(ctx *cli.Context) error, is executed when the "login" command is run.
func Run(ctx *cli.Context) error {
_default, options, err := loginLib.GetProfiles()
if err != nil {
Expand Down