NewCmd returns a new logout command
(ctx context.DnoteCtx)
| 38 | |
| 39 | // NewCmd returns a new logout command |
| 40 | func NewCmd(ctx context.DnoteCtx) *cobra.Command { |
| 41 | cmd := &cobra.Command{ |
| 42 | Use: "logout", |
| 43 | Short: "Logout from the server", |
| 44 | Example: example, |
| 45 | RunE: newRun(ctx), |
| 46 | } |
| 47 | |
| 48 | f := cmd.Flags() |
| 49 | f.StringVar(&apiEndpointFlag, "apiEndpoint", "", "API endpoint to connect to (defaults to value in config)") |
| 50 | |
| 51 | return cmd |
| 52 | } |
| 53 | |
| 54 | // Do performs logout |
| 55 | func Do(ctx context.DnoteCtx) error { |