cmd/status.go
changeset 129 11966471aac3
parent 113 2e411da68fd3
child 154 f07a61122b0d
equal deleted inserted replaced
128:e0621d1b9230 129:11966471aac3
    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 
    33 
    33 	// Used for several subcommands to limit the number of results
    34 	// Used for several subcommands to limit the number of results
    34 	limit uint
    35 	limit uint
    35 	//sinceID, maxID int64
    36 	//sinceID, maxID int64
    36 	all bool
    37 	all bool
    60 	statusPostSubcommand.Flags().StringVar(&statusOpts.mediaIDs, "media-ids", "", "Comma-separated list of media IDs")
    61 	statusPostSubcommand.Flags().StringVar(&statusOpts.mediaIDs, "media-ids", "", "Comma-separated list of media IDs")
    61 	statusPostSubcommand.Flags().StringVarP(&statusOpts.mediaFilePath, "file", "f", "", "Media file name")
    62 	statusPostSubcommand.Flags().StringVarP(&statusOpts.mediaFilePath, "file", "f", "", "Media file name")
    62 	statusPostSubcommand.Flags().StringVar(&statusOpts.textFilePath, "text-file", "", "Text file name (message content)")
    63 	statusPostSubcommand.Flags().StringVar(&statusOpts.textFilePath, "text-file", "", "Text file name (message content)")
    63 	statusPostSubcommand.Flags().Int64VarP(&statusOpts.inReplyToID, "in-reply-to", "r", 0, "Status ID to reply to")
    64 	statusPostSubcommand.Flags().Int64VarP(&statusOpts.inReplyToID, "in-reply-to", "r", 0, "Status ID to reply to")
    64 	statusPostSubcommand.Flags().BoolVar(&statusOpts.stdin, "stdin", false, "Read message content from standard input")
    65 	statusPostSubcommand.Flags().BoolVar(&statusOpts.stdin, "stdin", false, "Read message content from standard input")
       
    66 	statusPostSubcommand.Flags().BoolVar(&statusOpts.addMentions, "add-mentions", false, "Add mentions when replying")
    65 
    67 
    66 	// Flag completion
    68 	// Flag completion
    67 	annotation := make(map[string][]string)
    69 	annotation := make(map[string][]string)
    68 	annotation[cobra.BashCompCustom] = []string{"__madonctl_visibility"}
    70 	annotation[cobra.BashCompCustom] = []string{"__madonctl_visibility"}
    69 
    71 
   161 	Short:   "Post a message (same as 'madonctl toot')",
   163 	Short:   "Post a message (same as 'madonctl toot')",
   162 	Example: `  madonctl status post --spoiler Warning "Hello, World"
   164 	Example: `  madonctl status post --spoiler Warning "Hello, World"
   163   madonctl status toot --sensitive --file image.jpg Image
   165   madonctl status toot --sensitive --file image.jpg Image
   164   madonctl status post --media-ids ID1,ID2,ID3 Image
   166   madonctl status post --media-ids ID1,ID2,ID3 Image
   165   madonctl status toot --text-file message.txt
   167   madonctl status toot --text-file message.txt
       
   168   madonctl status post --in-reply-to STATUSID "@user response"
       
   169   madonctl status post --in-reply-to STATUSID --add-mentions "response"
   166   echo "Hello from #madonctl" | madonctl status toot --stdin
   170   echo "Hello from #madonctl" | madonctl status toot --stdin
   167 
   171 
   168 The default visibility can be set in the configuration file with the option
   172 The default visibility can be set in the configuration file with the option
   169 'default_visibility' (or with an environmnent variable).`,
   173 'default_visibility' (or with an environmnent variable).`,
   170 	RunE: func(cmd *cobra.Command, args []string) error {
   174 	RunE: func(cmd *cobra.Command, args []string) error {