deduplicate sortFlags toggles (#5019)
No logic changes, just removing a toggle that's already been set. --- #### Does this PR need a docs update or release note? - [x] ⛔ No #### Type of change - [x] 🧹 Tech Debt/Cleanup #### Issue(s) * #2988 #### Test Plan - [x] ⚡ Unit test - [x] 💚 E2E
This commit is contained in:
parent
dab53502ae
commit
1e2bf61fd8
@ -3,7 +3,6 @@ package backup
|
|||||||
import (
|
import (
|
||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
. "github.com/alcionai/corso/src/cli/print"
|
. "github.com/alcionai/corso/src/cli/print"
|
||||||
@ -62,15 +61,11 @@ corso backup details exchange --backup 1234abcd-12ab-cd34-56de-1234abcd \
|
|||||||
|
|
||||||
// called by backup.go to map subcommands to provider-specific handling.
|
// called by backup.go to map subcommands to provider-specific handling.
|
||||||
func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case createCommand:
|
case createCommand:
|
||||||
c, fs = utils.AddCommand(cmd, exchangeCreateCmd())
|
c, _ = utils.AddCommand(cmd, exchangeCreateCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + exchangeServiceCommandCreateUseSuffix
|
c.Use = c.Use + " " + exchangeServiceCommandCreateUseSuffix
|
||||||
c.Example = exchangeServiceCommandCreateExamples
|
c.Example = exchangeServiceCommandCreateExamples
|
||||||
@ -87,15 +82,13 @@ func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
flags.AddDisableSlidingWindowLimiterFlag(c)
|
flags.AddDisableSlidingWindowLimiterFlag(c)
|
||||||
|
|
||||||
case listCommand:
|
case listCommand:
|
||||||
c, fs = utils.AddCommand(cmd, exchangeListCmd())
|
c, _ = utils.AddCommand(cmd, exchangeListCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, false)
|
flags.AddBackupIDFlag(c, false)
|
||||||
flags.AddAllBackupListFlags(c)
|
flags.AddAllBackupListFlags(c)
|
||||||
|
|
||||||
case detailsCommand:
|
case detailsCommand:
|
||||||
c, fs = utils.AddCommand(cmd, exchangeDetailsCmd())
|
c, _ = utils.AddCommand(cmd, exchangeDetailsCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + exchangeServiceCommandDetailsUseSuffix
|
c.Use = c.Use + " " + exchangeServiceCommandDetailsUseSuffix
|
||||||
c.Example = exchangeServiceCommandDetailsExamples
|
c.Example = exchangeServiceCommandDetailsExamples
|
||||||
@ -108,8 +101,7 @@ func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
flags.AddExchangeDetailsAndRestoreFlags(c, false)
|
flags.AddExchangeDetailsAndRestoreFlags(c, false)
|
||||||
|
|
||||||
case deleteCommand:
|
case deleteCommand:
|
||||||
c, fs = utils.AddCommand(cmd, exchangeDeleteCmd())
|
c, _ = utils.AddCommand(cmd, exchangeDeleteCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + exchangeServiceCommandDeleteUseSuffix
|
c.Use = c.Use + " " + exchangeServiceCommandDeleteUseSuffix
|
||||||
c.Example = exchangeServiceCommandDeleteExamples
|
c.Example = exchangeServiceCommandDeleteExamples
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import (
|
|||||||
|
|
||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
@ -56,15 +55,11 @@ corso backup details groups --backup 1234abcd-12ab-cd34-56de-1234abcd \
|
|||||||
|
|
||||||
// called by backup.go to map subcommands to provider-specific handling.
|
// called by backup.go to map subcommands to provider-specific handling.
|
||||||
func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case createCommand:
|
case createCommand:
|
||||||
c, fs = utils.AddCommand(cmd, groupsCreateCmd(), utils.MarkPreviewCommand())
|
c, _ = utils.AddCommand(cmd, groupsCreateCmd(), utils.MarkPreviewCommand())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + groupsServiceCommandCreateUseSuffix
|
c.Use = c.Use + " " + groupsServiceCommandCreateUseSuffix
|
||||||
c.Example = groupsServiceCommandCreateExamples
|
c.Example = groupsServiceCommandCreateExamples
|
||||||
@ -78,15 +73,13 @@ func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
flags.AddDisableLazyItemReader(c)
|
flags.AddDisableLazyItemReader(c)
|
||||||
|
|
||||||
case listCommand:
|
case listCommand:
|
||||||
c, fs = utils.AddCommand(cmd, groupsListCmd(), utils.MarkPreviewCommand())
|
c, _ = utils.AddCommand(cmd, groupsListCmd(), utils.MarkPreviewCommand())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, false)
|
flags.AddBackupIDFlag(c, false)
|
||||||
flags.AddAllBackupListFlags(c)
|
flags.AddAllBackupListFlags(c)
|
||||||
|
|
||||||
case detailsCommand:
|
case detailsCommand:
|
||||||
c, fs = utils.AddCommand(cmd, groupsDetailsCmd(), utils.MarkPreviewCommand())
|
c, _ = utils.AddCommand(cmd, groupsDetailsCmd(), utils.MarkPreviewCommand())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + groupsServiceCommandDetailsUseSuffix
|
c.Use = c.Use + " " + groupsServiceCommandDetailsUseSuffix
|
||||||
c.Example = groupsServiceCommandDetailsExamples
|
c.Example = groupsServiceCommandDetailsExamples
|
||||||
@ -100,8 +93,7 @@ func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
flags.AddSharePointDetailsAndRestoreFlags(c)
|
flags.AddSharePointDetailsAndRestoreFlags(c)
|
||||||
|
|
||||||
case deleteCommand:
|
case deleteCommand:
|
||||||
c, fs = utils.AddCommand(cmd, groupsDeleteCmd(), utils.MarkPreviewCommand())
|
c, _ = utils.AddCommand(cmd, groupsDeleteCmd(), utils.MarkPreviewCommand())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + groupsServiceCommandDeleteUseSuffix
|
c.Use = c.Use + " " + groupsServiceCommandDeleteUseSuffix
|
||||||
c.Example = groupsServiceCommandDeleteExamples
|
c.Example = groupsServiceCommandDeleteExamples
|
||||||
|
|||||||
@ -60,7 +60,6 @@ func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case createCommand:
|
case createCommand:
|
||||||
c, fs = utils.AddCommand(cmd, oneDriveCreateCmd())
|
c, fs = utils.AddCommand(cmd, oneDriveCreateCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + oneDriveServiceCommandCreateUseSuffix
|
c.Use = c.Use + " " + oneDriveServiceCommandCreateUseSuffix
|
||||||
c.Example = oneDriveServiceCommandCreateExamples
|
c.Example = oneDriveServiceCommandCreateExamples
|
||||||
@ -75,15 +74,13 @@ func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
cobra.CheckErr(fs.MarkHidden(flags.UseDeltaTreeFN))
|
cobra.CheckErr(fs.MarkHidden(flags.UseDeltaTreeFN))
|
||||||
|
|
||||||
case listCommand:
|
case listCommand:
|
||||||
c, fs = utils.AddCommand(cmd, oneDriveListCmd())
|
c, _ = utils.AddCommand(cmd, oneDriveListCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, false)
|
flags.AddBackupIDFlag(c, false)
|
||||||
flags.AddAllBackupListFlags(c)
|
flags.AddAllBackupListFlags(c)
|
||||||
|
|
||||||
case detailsCommand:
|
case detailsCommand:
|
||||||
c, fs = utils.AddCommand(cmd, oneDriveDetailsCmd())
|
c, _ = utils.AddCommand(cmd, oneDriveDetailsCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + oneDriveServiceCommandDetailsUseSuffix
|
c.Use = c.Use + " " + oneDriveServiceCommandDetailsUseSuffix
|
||||||
c.Example = oneDriveServiceCommandDetailsExamples
|
c.Example = oneDriveServiceCommandDetailsExamples
|
||||||
@ -93,8 +90,7 @@ func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
flags.AddOneDriveDetailsAndRestoreFlags(c)
|
flags.AddOneDriveDetailsAndRestoreFlags(c)
|
||||||
|
|
||||||
case deleteCommand:
|
case deleteCommand:
|
||||||
c, fs = utils.AddCommand(cmd, oneDriveDeleteCmd())
|
c, _ = utils.AddCommand(cmd, oneDriveDeleteCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + oneDriveServiceCommandDeleteUseSuffix
|
c.Use = c.Use + " " + oneDriveServiceCommandDeleteUseSuffix
|
||||||
c.Example = oneDriveServiceCommandDeleteExamples
|
c.Example = oneDriveServiceCommandDeleteExamples
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import (
|
|||||||
|
|
||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
@ -63,15 +62,11 @@ corso backup details sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd \
|
|||||||
|
|
||||||
// called by backup.go to map subcommands to provider-specific handling.
|
// called by backup.go to map subcommands to provider-specific handling.
|
||||||
func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case createCommand:
|
case createCommand:
|
||||||
c, fs = utils.AddCommand(cmd, sharePointCreateCmd())
|
c, _ = utils.AddCommand(cmd, sharePointCreateCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + sharePointServiceCommandCreateUseSuffix
|
c.Use = c.Use + " " + sharePointServiceCommandCreateUseSuffix
|
||||||
c.Example = sharePointServiceCommandCreateExamples
|
c.Example = sharePointServiceCommandCreateExamples
|
||||||
@ -82,15 +77,13 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
flags.AddGenericBackupFlags(c)
|
flags.AddGenericBackupFlags(c)
|
||||||
|
|
||||||
case listCommand:
|
case listCommand:
|
||||||
c, fs = utils.AddCommand(cmd, sharePointListCmd())
|
c, _ = utils.AddCommand(cmd, sharePointListCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, false)
|
flags.AddBackupIDFlag(c, false)
|
||||||
flags.AddAllBackupListFlags(c)
|
flags.AddAllBackupListFlags(c)
|
||||||
|
|
||||||
case detailsCommand:
|
case detailsCommand:
|
||||||
c, fs = utils.AddCommand(cmd, sharePointDetailsCmd())
|
c, _ = utils.AddCommand(cmd, sharePointDetailsCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + sharePointServiceCommandDetailsUseSuffix
|
c.Use = c.Use + " " + sharePointServiceCommandDetailsUseSuffix
|
||||||
c.Example = sharePointServiceCommandDetailsExamples
|
c.Example = sharePointServiceCommandDetailsExamples
|
||||||
@ -100,8 +93,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
flags.AddSharePointDetailsAndRestoreFlags(c)
|
flags.AddSharePointDetailsAndRestoreFlags(c)
|
||||||
|
|
||||||
case deleteCommand:
|
case deleteCommand:
|
||||||
c, fs = utils.AddCommand(cmd, sharePointDeleteCmd())
|
c, _ = utils.AddCommand(cmd, sharePointDeleteCmd())
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
c.Use = c.Use + " " + sharePointServiceCommandDeleteUseSuffix
|
c.Use = c.Use + " " + sharePointServiceCommandDeleteUseSuffix
|
||||||
c.Example = sharePointServiceCommandDeleteExamples
|
c.Example = sharePointServiceCommandDeleteExamples
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package debug
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -11,21 +10,13 @@ import (
|
|||||||
|
|
||||||
// called by debug.go to map subcommands to provider-specific handling.
|
// called by debug.go to map subcommands to provider-specific handling.
|
||||||
func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case metadataFilesCommand:
|
case metadataFilesCommand:
|
||||||
c, fs = utils.AddCommand(cmd, exchangeMetadataFilesCmd(), utils.MarkDebugCommand())
|
c, _ = utils.AddCommand(cmd, exchangeMetadataFilesCmd(), utils.MarkDebugCommand())
|
||||||
|
|
||||||
c.Use = c.Use + " " + exchangeServiceCommandUseSuffix
|
c.Use = c.Use + " " + exchangeServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package debug
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -11,21 +10,14 @@ import (
|
|||||||
|
|
||||||
// called by debug.go to map subcommands to provider-specific handling.
|
// called by debug.go to map subcommands to provider-specific handling.
|
||||||
func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case metadataFilesCommand:
|
case metadataFilesCommand:
|
||||||
c, fs = utils.AddCommand(cmd, groupsMetadataFilesCmd(), utils.MarkDebugCommand())
|
c, _ = utils.AddCommand(cmd, groupsMetadataFilesCmd(), utils.MarkDebugCommand())
|
||||||
|
|
||||||
c.Use = c.Use + " " + groupsServiceCommandUseSuffix
|
c.Use = c.Use + " " + groupsServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package debug
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -11,21 +10,13 @@ import (
|
|||||||
|
|
||||||
// called by debug.go to map subcommands to provider-specific handling.
|
// called by debug.go to map subcommands to provider-specific handling.
|
||||||
func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case metadataFilesCommand:
|
case metadataFilesCommand:
|
||||||
c, fs = utils.AddCommand(cmd, oneDriveMetadataFilesCmd(), utils.MarkDebugCommand())
|
c, _ = utils.AddCommand(cmd, oneDriveMetadataFilesCmd(), utils.MarkDebugCommand())
|
||||||
|
|
||||||
c.Use = c.Use + " " + oneDriveServiceCommandUseSuffix
|
c.Use = c.Use + " " + oneDriveServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package debug
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -11,21 +10,13 @@ import (
|
|||||||
|
|
||||||
// called by debug.go to map subcommands to provider-specific handling.
|
// called by debug.go to map subcommands to provider-specific handling.
|
||||||
func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case metadataFilesCommand:
|
case metadataFilesCommand:
|
||||||
c, fs = utils.AddCommand(cmd, sharePointMetadataFilesCmd(), utils.MarkDebugCommand())
|
c, _ = utils.AddCommand(cmd, sharePointMetadataFilesCmd(), utils.MarkDebugCommand())
|
||||||
|
|
||||||
c.Use = c.Use + " " + sharePointServiceCommandUseSuffix
|
c.Use = c.Use + " " + sharePointServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package export
|
|||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -11,21 +10,14 @@ import (
|
|||||||
|
|
||||||
// called by export.go to map subcommands to provider-specific handling.
|
// called by export.go to map subcommands to provider-specific handling.
|
||||||
func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case exportCommand:
|
case exportCommand:
|
||||||
c, fs = utils.AddCommand(cmd, exchangeExportCmd())
|
c, _ = utils.AddCommand(cmd, exchangeExportCmd())
|
||||||
|
|
||||||
c.Use = c.Use + " " + exchangeServiceCommandUseSuffix
|
c.Use = c.Use + " " + exchangeServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
flags.AddExchangeDetailsAndRestoreFlags(c, true)
|
flags.AddExchangeDetailsAndRestoreFlags(c, true)
|
||||||
flags.AddExportConfigFlags(c)
|
flags.AddExportConfigFlags(c)
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package export
|
|||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -13,21 +12,14 @@ import (
|
|||||||
|
|
||||||
// called by export.go to map subcommands to provider-specific handling.
|
// called by export.go to map subcommands to provider-specific handling.
|
||||||
func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case exportCommand:
|
case exportCommand:
|
||||||
c, fs = utils.AddCommand(cmd, groupsExportCmd(), utils.MarkPreviewCommand())
|
c, _ = utils.AddCommand(cmd, groupsExportCmd(), utils.MarkPreviewCommand())
|
||||||
|
|
||||||
c.Use = c.Use + " " + groupsServiceCommandUseSuffix
|
c.Use = c.Use + " " + groupsServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
flags.AddSiteFlag(c, false)
|
flags.AddSiteFlag(c, false)
|
||||||
flags.AddSiteIDFlag(c, false)
|
flags.AddSiteIDFlag(c, false)
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package export
|
|||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -11,21 +10,14 @@ import (
|
|||||||
|
|
||||||
// called by export.go to map subcommands to provider-specific handling.
|
// called by export.go to map subcommands to provider-specific handling.
|
||||||
func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case exportCommand:
|
case exportCommand:
|
||||||
c, fs = utils.AddCommand(cmd, oneDriveExportCmd())
|
c, _ = utils.AddCommand(cmd, oneDriveExportCmd())
|
||||||
|
|
||||||
c.Use = c.Use + " " + oneDriveServiceCommandUseSuffix
|
c.Use = c.Use + " " + oneDriveServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
flags.AddOneDriveDetailsAndRestoreFlags(c)
|
flags.AddOneDriveDetailsAndRestoreFlags(c)
|
||||||
flags.AddExportConfigFlags(c)
|
flags.AddExportConfigFlags(c)
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package export
|
|||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -12,21 +11,14 @@ import (
|
|||||||
|
|
||||||
// called by export.go to map subcommands to provider-specific handling.
|
// called by export.go to map subcommands to provider-specific handling.
|
||||||
func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case exportCommand:
|
case exportCommand:
|
||||||
c, fs = utils.AddCommand(cmd, sharePointExportCmd())
|
c, _ = utils.AddCommand(cmd, sharePointExportCmd())
|
||||||
|
|
||||||
c.Use = c.Use + " " + sharePointServiceCommandUseSuffix
|
c.Use = c.Use + " " + sharePointServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
flags.AddSharePointDetailsAndRestoreFlags(c)
|
flags.AddSharePointDetailsAndRestoreFlags(c)
|
||||||
flags.AddExportConfigFlags(c)
|
flags.AddExportConfigFlags(c)
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package restore
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -10,22 +9,14 @@ import (
|
|||||||
|
|
||||||
// called by restore.go to map subcommands to provider-specific handling.
|
// called by restore.go to map subcommands to provider-specific handling.
|
||||||
func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
func addExchangeCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case restoreCommand:
|
case restoreCommand:
|
||||||
c, fs = utils.AddCommand(cmd, exchangeRestoreCmd())
|
c, _ = utils.AddCommand(cmd, exchangeRestoreCmd())
|
||||||
|
|
||||||
c.Use = c.Use + " " + exchangeServiceCommandUseSuffix
|
c.Use = c.Use + " " + exchangeServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
// general flags
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
flags.AddExchangeDetailsAndRestoreFlags(c, false)
|
flags.AddExchangeDetailsAndRestoreFlags(c, false)
|
||||||
flags.AddRestoreConfigFlags(c, true)
|
flags.AddRestoreConfigFlags(c, true)
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package restore
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -12,21 +11,14 @@ import (
|
|||||||
|
|
||||||
// called by restore.go to map subcommands to provider-specific handling.
|
// called by restore.go to map subcommands to provider-specific handling.
|
||||||
func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
func addGroupsCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case restoreCommand:
|
case restoreCommand:
|
||||||
c, fs = utils.AddCommand(cmd, groupsRestoreCmd(), utils.MarkPreviewCommand())
|
c, _ = utils.AddCommand(cmd, groupsRestoreCmd(), utils.MarkPreviewCommand())
|
||||||
|
|
||||||
c.Use = c.Use + " " + groupsServiceCommandUseSuffix
|
c.Use = c.Use + " " + groupsServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
flags.AddSiteFlag(c, false)
|
flags.AddSiteFlag(c, false)
|
||||||
flags.AddSiteIDFlag(c, false)
|
flags.AddSiteIDFlag(c, false)
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package restore
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -11,21 +10,14 @@ import (
|
|||||||
|
|
||||||
// called by restore.go to map subcommands to provider-specific handling.
|
// called by restore.go to map subcommands to provider-specific handling.
|
||||||
func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case restoreCommand:
|
case restoreCommand:
|
||||||
c, fs = utils.AddCommand(cmd, oneDriveRestoreCmd())
|
c, _ = utils.AddCommand(cmd, oneDriveRestoreCmd())
|
||||||
|
|
||||||
c.Use = c.Use + " " + oneDriveServiceCommandUseSuffix
|
c.Use = c.Use + " " + oneDriveServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --user) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
flags.AddOneDriveDetailsAndRestoreFlags(c)
|
flags.AddOneDriveDetailsAndRestoreFlags(c)
|
||||||
flags.AddNoPermissionsFlag(c)
|
flags.AddNoPermissionsFlag(c)
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package restore
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
@ -12,21 +11,14 @@ import (
|
|||||||
|
|
||||||
// called by restore.go to map subcommands to provider-specific handling.
|
// called by restore.go to map subcommands to provider-specific handling.
|
||||||
func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
||||||
var (
|
var c *cobra.Command
|
||||||
c *cobra.Command
|
|
||||||
fs *pflag.FlagSet
|
|
||||||
)
|
|
||||||
|
|
||||||
switch cmd.Use {
|
switch cmd.Use {
|
||||||
case restoreCommand:
|
case restoreCommand:
|
||||||
c, fs = utils.AddCommand(cmd, sharePointRestoreCmd())
|
c, _ = utils.AddCommand(cmd, sharePointRestoreCmd())
|
||||||
|
|
||||||
c.Use = c.Use + " " + sharePointServiceCommandUseSuffix
|
c.Use = c.Use + " " + sharePointServiceCommandUseSuffix
|
||||||
|
|
||||||
// Flags addition ordering should follow the order we want them to appear in help and docs:
|
|
||||||
// More generic (ex: --site) and more frequently used flags take precedence.
|
|
||||||
fs.SortFlags = false
|
|
||||||
|
|
||||||
flags.AddBackupIDFlag(c, true)
|
flags.AddBackupIDFlag(c, true)
|
||||||
flags.AddSharePointDetailsAndRestoreFlags(c)
|
flags.AddSharePointDetailsAndRestoreFlags(c)
|
||||||
flags.AddNoPermissionsFlag(c)
|
flags.AddNoPermissionsFlag(c)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user