cmd/status.go
changeset 168 ce4000ac7294
parent 167 1341bacd01c9
child 176 7efbbed5cf3c
equal deleted inserted replaced
167:1341bacd01c9 168:ce4000ac7294
    19 var statusOpts struct {
    19 var statusOpts struct {
    20 	statusID int64
    20 	statusID int64
    21 	unset    bool
    21 	unset    bool
    22 
    22 
    23 	// The following fields are used for the post/toot command
    23 	// The following fields are used for the post/toot command
    24 	visibility    string
    24 	visibility     string
    25 	sensitive     bool
    25 	sensitive      bool
    26 	spoiler       string
    26 	spoiler        string
    27 	inReplyToID   int64
    27 	inReplyToID    int64
    28 	mediaIDs      string
    28 	mediaIDs       string
    29 	mediaFilePath string
    29 	mediaFilePath  string
    30 	textFilePath  string
    30 	textFilePath   string
    31 	stdin         bool
    31 	stdin          bool
    32 	addMentions   bool
    32 	addMentions    bool
       
    33 	sameVisibility bool
    33 
    34 
    34 	// Used for several subcommands to limit the number of results
    35 	// Used for several subcommands to limit the number of results
    35 	limit, keep uint
    36 	limit, keep uint
    36 	//sinceID, maxID int64
    37 	//sinceID, maxID int64
    37 	all bool
    38 	all bool
    63 	statusPostSubcommand.Flags().StringVarP(&statusOpts.mediaFilePath, "file", "f", "", "Media file name")
    64 	statusPostSubcommand.Flags().StringVarP(&statusOpts.mediaFilePath, "file", "f", "", "Media file name")
    64 	statusPostSubcommand.Flags().StringVar(&statusOpts.textFilePath, "text-file", "", "Text file name (message content)")
    65 	statusPostSubcommand.Flags().StringVar(&statusOpts.textFilePath, "text-file", "", "Text file name (message content)")
    65 	statusPostSubcommand.Flags().Int64VarP(&statusOpts.inReplyToID, "in-reply-to", "r", 0, "Status ID to reply to")
    66 	statusPostSubcommand.Flags().Int64VarP(&statusOpts.inReplyToID, "in-reply-to", "r", 0, "Status ID to reply to")
    66 	statusPostSubcommand.Flags().BoolVar(&statusOpts.stdin, "stdin", false, "Read message content from standard input")
    67 	statusPostSubcommand.Flags().BoolVar(&statusOpts.stdin, "stdin", false, "Read message content from standard input")
    67 	statusPostSubcommand.Flags().BoolVar(&statusOpts.addMentions, "add-mentions", false, "Add mentions when replying")
    68 	statusPostSubcommand.Flags().BoolVar(&statusOpts.addMentions, "add-mentions", false, "Add mentions when replying")
       
    69 	statusPostSubcommand.Flags().BoolVar(&statusOpts.sameVisibility, "same-visibility", false, "Use same visibility as original message (for replies)")
    68 
    70 
    69 	// Flag completion
    71 	// Flag completion
    70 	annotation := make(map[string][]string)
    72 	annotation := make(map[string][]string)
    71 	annotation[cobra.BashCompCustom] = []string{"__madonctl_visibility"}
    73 	annotation[cobra.BashCompCustom] = []string{"__madonctl_visibility"}
    72 
    74 
    73 	statusPostSubcommand.Flags().Lookup("visibility").Annotations = annotation
    75 	statusPostSubcommand.Flags().Lookup("visibility").Annotations = annotation
       
    76 
       
    77 	// This one will be used to check if the options were explicitly set or not
       
    78 	updateFlags = statusPostSubcommand.Flags()
    74 }
    79 }
    75 
    80 
    76 // statusCmd represents the status command
    81 // statusCmd represents the status command
    77 // This command does nothing without a subcommand
    82 // This command does nothing without a subcommand
    78 var statusCmd = &cobra.Command{
    83 var statusCmd = &cobra.Command{