summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d90f61a)
This allows to use send-in-background without mangling the message's text.
.RS 4
Add the working directory and a \'$\' in the tweet message to help specify it is coming from a command line\&. Don\'t put the working directory and the \'$\' in the tweet message\&.
.sp
.RS 4
Add the working directory and a \'$\' in the tweet message to help specify it is coming from a command line\&. Don\'t put the working directory and the \'$\' in the tweet message\&.
.sp
-This mode also does not report back any errors that might have happened when sending the message, and it sends it in the background, returning immediately, allowing the process to continue on\&.
+This option implies
+\fB\-\-background\fR\&.
+.RE
+.PP
+\fB\-\-background\fR
+.RS 4
+Do not report back any errors that might have happened when sending the message, and send it in the background, returning immediately, allowing the user to continue on\&.
.RE
.PP
\fB\-\-version\fR
.RE
.PP
\fB\-\-version\fR
char *configfile;
char *replyto;
int bash;
char *configfile;
char *replyto;
int bash;
int interactive;
int shrink_urls;
int dry_run;
int interactive;
int shrink_urls;
int dry_run;
fprintf(stdout, " --shrink-urls\n");
fprintf(stdout, " --page PAGENUMBER\n");
fprintf(stdout, " --bash\n");
fprintf(stdout, " --shrink-urls\n");
fprintf(stdout, " --page PAGENUMBER\n");
fprintf(stdout, " --bash\n");
+ fprintf(stdout, " --background\n");
fprintf(stdout, " --debug\n");
fprintf(stdout, " --verbose\n");
fprintf(stdout, " --dry-run\n");
fprintf(stdout, " --debug\n");
fprintf(stdout, " --verbose\n");
fprintf(stdout, " --dry-run\n");
curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl_buf);
if (!session->dry_run) {
res = curl_easy_perform(curl);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl_buf);
if (!session->dry_run) {
res = curl_easy_perform(curl);
- if (res && !session->bash) {
+ if (res && !session->background) {
fprintf(stderr, "error(%d) trying to perform "
"operation\n", res);
return -EINVAL;
fprintf(stderr, "error(%d) trying to perform "
"operation\n", res);
return -EINVAL;
{ "shrink-urls", 0, NULL, 's' },
{ "help", 0, NULL, 'h' },
{ "bash", 0, NULL, 'b' },
{ "shrink-urls", 0, NULL, 's' },
{ "help", 0, NULL, 'h' },
{ "bash", 0, NULL, 'b' },
+ { "background", 0, NULL, 'B' },
{ "dry-run", 0, NULL, 'n' },
{ "page", 1, NULL, 'g' },
{ "version", 0, NULL, 'v' },
{ "dry-run", 0, NULL, 'n' },
{ "page", 1, NULL, 'g' },
{ "version", 0, NULL, 'v' },
break;
case 'b':
session->bash = 1;
break;
case 'b':
session->bash = 1;
+ /* fall-through intended */
+ case 'B':
+ session->background = 1;
break;
case 'c':
if (session->configfile)
break;
case 'c':
if (session->configfile)
}
if (session->action == ACTION_UPDATE) {
}
if (session->action == ACTION_UPDATE) {
- if (session->bash || !session->interactive)
+ if (session->background || !session->interactive)
tweet = get_string_from_stdin();
else
tweet = session->readline("tweet: ");
tweet = get_string_from_stdin();
else
tweet = session->readline("tweet: ");
/* fork ourself so that the main shell can get on
* with it's life as we try to connect and handle everything
*/
/* fork ourself so that the main shell can get on
* with it's life as we try to connect and handle everything
*/
+ if (session->background) {
child = fork();
if (child) {
dbg("child is %d\n", child);
child = fork();
if (child) {
dbg("child is %d\n", child);
}
retval = send_request(session);
}
retval = send_request(session);
- if (retval && !session->bash)
+ if (retval && !session->background)
fprintf(stderr, "operation failed\n");
log_session(session, retval);
fprintf(stderr, "operation failed\n");
log_session(session, retval);
help specify it is coming from a command line. Don't put the
working directory and the '$' in the tweet message.
</para>
help specify it is coming from a command line. Don't put the
working directory and the '$' in the tweet message.
</para>
+
+ <para>
+ This option implies <option>--background</option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--background</option></term>
+ <listitem>
- This mode also does not report back any errors that might have
- happened when sending the message, and it sends it in the
- background, returning immediately, allowing the process to
- continue on.
+ Do not report back any errors that might have
+ happened when sending the message, and send it in the
+ background, returning immediately, allowing the user
+ to continue on.
</para>
</listitem>
</varlistentry>
</para>
</listitem>
</varlistentry>