use StringSlice pflag func to split flag inputs (#468)
This commit is contained in:
parent
d656bc181c
commit
88a8e992fd
@ -54,9 +54,9 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
|
|
||||||
case createCommand:
|
case createCommand:
|
||||||
c, fs = utils.AddCommand(parent, exchangeCreateCmd)
|
c, fs = utils.AddCommand(parent, exchangeCreateCmd)
|
||||||
fs.StringArrayVar(&user, "user", nil, "Backup Exchange data by user ID; accepts "+utils.Wildcard+" to select all users")
|
fs.StringSliceVar(&user, "user", nil, "Backup Exchange data by user ID; accepts "+utils.Wildcard+" to select all users")
|
||||||
fs.BoolVar(&exchangeAll, "all", false, "Backup all Exchange data for all users")
|
fs.BoolVar(&exchangeAll, "all", false, "Backup all Exchange data for all users")
|
||||||
fs.StringArrayVar(
|
fs.StringSliceVar(
|
||||||
&exchangeData,
|
&exchangeData,
|
||||||
"data",
|
"data",
|
||||||
nil,
|
nil,
|
||||||
@ -72,20 +72,20 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
cobra.CheckErr(c.MarkFlagRequired("backup"))
|
cobra.CheckErr(c.MarkFlagRequired("backup"))
|
||||||
|
|
||||||
// per-data-type flags
|
// per-data-type flags
|
||||||
fs.StringArrayVar(&contact, "contact", nil, "Select backup details by contact ID; accepts "+utils.Wildcard+" to select all contacts")
|
fs.StringSliceVar(&contact, "contact", nil, "Select backup details by contact ID; accepts "+utils.Wildcard+" to select all contacts")
|
||||||
fs.StringArrayVar(
|
fs.StringSliceVar(
|
||||||
&contactFolder,
|
&contactFolder,
|
||||||
"contact-folder",
|
"contact-folder",
|
||||||
nil,
|
nil,
|
||||||
"Select backup details by contact folder ID; accepts "+utils.Wildcard+" to select all contact folders")
|
"Select backup details by contact folder ID; accepts "+utils.Wildcard+" to select all contact folders")
|
||||||
fs.StringArrayVar(&email, "email", nil, "Select backup details by emails ID; accepts "+utils.Wildcard+" to select all emails")
|
fs.StringSliceVar(&email, "email", nil, "Select backup details by emails ID; accepts "+utils.Wildcard+" to select all emails")
|
||||||
fs.StringArrayVar(
|
fs.StringSliceVar(
|
||||||
&emailFolder,
|
&emailFolder,
|
||||||
"email-folder",
|
"email-folder",
|
||||||
nil,
|
nil,
|
||||||
"Select backup details by email folder ID; accepts "+utils.Wildcard+" to select all email folderss")
|
"Select backup details by email folder ID; accepts "+utils.Wildcard+" to select all email folderss")
|
||||||
fs.StringArrayVar(&event, "event", nil, "Select backup details by event ID; accepts "+utils.Wildcard+" to select all events")
|
fs.StringSliceVar(&event, "event", nil, "Select backup details by event ID; accepts "+utils.Wildcard+" to select all events")
|
||||||
fs.StringArrayVar(&user, "user", nil, "Select backup details by user ID; accepts "+utils.Wildcard+" to select all users")
|
fs.StringSliceVar(&user, "user", nil, "Select backup details by user ID; accepts "+utils.Wildcard+" to select all users")
|
||||||
|
|
||||||
// TODO: reveal these flags when their production is supported in GC
|
// TODO: reveal these flags when their production is supported in GC
|
||||||
cobra.CheckErr(fs.MarkHidden("contact"))
|
cobra.CheckErr(fs.MarkHidden("contact"))
|
||||||
|
|||||||
@ -43,20 +43,20 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
cobra.CheckErr(c.MarkFlagRequired("backup"))
|
cobra.CheckErr(c.MarkFlagRequired("backup"))
|
||||||
|
|
||||||
// per-data-type flags
|
// per-data-type flags
|
||||||
fs.StringArrayVar(&contact, "contact", nil, "Restore contacts by ID; accepts "+utils.Wildcard+" to select all contacts")
|
fs.StringSliceVar(&contact, "contact", nil, "Restore contacts by ID; accepts "+utils.Wildcard+" to select all contacts")
|
||||||
fs.StringArrayVar(
|
fs.StringSliceVar(
|
||||||
&contactFolder,
|
&contactFolder,
|
||||||
"contact-folder",
|
"contact-folder",
|
||||||
nil,
|
nil,
|
||||||
"Restore all contacts within the folder ID; accepts "+utils.Wildcard+" to select all contact folders")
|
"Restore all contacts within the folder ID; accepts "+utils.Wildcard+" to select all contact folders")
|
||||||
fs.StringArrayVar(&email, "email", nil, "Restore emails by ID; accepts "+utils.Wildcard+" to select all emails")
|
fs.StringSliceVar(&email, "email", nil, "Restore emails by ID; accepts "+utils.Wildcard+" to select all emails")
|
||||||
fs.StringArrayVar(
|
fs.StringSliceVar(
|
||||||
&emailFolder,
|
&emailFolder,
|
||||||
"email-folder",
|
"email-folder",
|
||||||
nil,
|
nil,
|
||||||
"Restore all emails by folder ID; accepts "+utils.Wildcard+" to select all email folders")
|
"Restore all emails by folder ID; accepts "+utils.Wildcard+" to select all email folders")
|
||||||
fs.StringArrayVar(&event, "event", nil, "Restore events by ID; accepts "+utils.Wildcard+" to select all events")
|
fs.StringSliceVar(&event, "event", nil, "Restore events by ID; accepts "+utils.Wildcard+" to select all events")
|
||||||
fs.StringArrayVar(&user, "user", nil, "Restore all data by user ID; accepts "+utils.Wildcard+" to select all users")
|
fs.StringSliceVar(&user, "user", nil, "Restore all data by user ID; accepts "+utils.Wildcard+" to select all users")
|
||||||
|
|
||||||
// TODO: reveal these flags when their production is supported in GC
|
// TODO: reveal these flags when their production is supported in GC
|
||||||
cobra.CheckErr(fs.MarkHidden("contact"))
|
cobra.CheckErr(fs.MarkHidden("contact"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user