2022-05-30 13:43:02 +00:00
|
|
|
package commonflags
|
|
|
|
|
2022-10-20 09:40:33 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
2022-05-30 13:43:02 +00:00
|
|
|
|
|
|
|
const SessionToken = "session"
|
|
|
|
|
2023-02-03 16:29:25 +00:00
|
|
|
// InitSession registers SessionToken flag representing file path to the token of
|
|
|
|
// the session with the given name. Supports FrostFS-binary and JSON files.
|
2022-10-20 09:40:33 +00:00
|
|
|
func InitSession(cmd *cobra.Command, name string) {
|
2022-05-30 13:43:02 +00:00
|
|
|
cmd.Flags().String(
|
|
|
|
SessionToken,
|
|
|
|
"",
|
2022-10-20 09:40:33 +00:00
|
|
|
fmt.Sprintf("Filepath to a JSON- or binary-encoded token of the %s session", name),
|
2022-05-30 13:43:02 +00:00
|
|
|
)
|
|
|
|
}
|