forked from TrueCloudLab/frostfs-node
923f84722a
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
19 lines
440 B
Go
19 lines
440 B
Go
package commonflags
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
const SessionToken = "session"
|
|
|
|
// InitSession registers SessionToken flag representing filepath to the token
|
|
// of the session with the given name. Supports NeoFS-binary and JSON files.
|
|
func InitSession(cmd *cobra.Command, name string) {
|
|
cmd.Flags().String(
|
|
SessionToken,
|
|
"",
|
|
fmt.Sprintf("Filepath to a JSON- or binary-encoded token of the %s session", name),
|
|
)
|
|
}
|