Thanks to Reuben Thomas <rrt@sc3d.org> for this idea.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
bti \- send a tweet to twitter\&.com or identi\&.ca from the command line
.SH "SYNOPSIS"
.HP \w'\fBbti\fR\ 'u
-\fBbti\fR [\fB\-\-account\ account\fR] [\fB\-\-password\ password\fR] [\fB\-\-action\ action\fR] [\fB\-\-user\ screenname\fR] [\fB\-\-host\ HOST_NAME\fR] [\fB\-\-proxy\ PROXY:PORT\fR] [\fB\-\-logfile\ LOGFILE\fR] [\fB\-\-page\ PAGENUMBER\fR] [\fB\-\-bash\fR] [\fB\-\-shrink\-urls\fR] [\fB\-\-debug\fR] [\fB\-\-dry\-run\fR] [\fB\-\-verbose\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
+\fBbti\fR [\fB\-\-account\ account\fR] [\fB\-\-password\ password\fR] [\fB\-\-action\ action\fR] [\fB\-\-user\ screenname\fR] [\fB\-\-host\ HOST_NAME\fR] [\fB\-\-proxy\ PROXY:PORT\fR] [\fB\-\-logfile\ LOGFILE\fR] [\fB\-\-config\ CONFIGFILE\fR] [\fB\-\-page\ PAGENUMBER\fR] [\fB\-\-bash\fR] [\fB\-\-shrink\-urls\fR] [\fB\-\-debug\fR] [\fB\-\-dry\-run\fR] [\fB\-\-verbose\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
.SH "DESCRIPTION"
.PP
bti sends a tweet message to twitter\&.com or identi\&.ca\&.
Specify a logfile for bti to write status messages to\&. LOGFILE is in relation to the user\'s home directory, not an absolute path to a file\&.
.RE
.PP
+\fB\-\-config CONFIGFILE\fR
+.RS 4
+Specify a config file for bti to read from\&. By default, bti looks in the ~/\&.bti file for config values\&. This default location can be overridden by setting a specific file with this option\&.
+.RE
+.PP
\fB\-\-shrink\-urls\fR
.RS 4
Scans the tweet text for valid URL patterns and passes each through the supplied bti\-shrink\-urls script\&. The script will pass the URL to a web service that shrinks the URLs, making it more suitable for micro\-blogging\&.
environment variables
.RE
.PP
-For example, command line options always override any config file option, or any environment variables\&.
+For example, command line options always override any config file option, or any environment variables\&. Unless a config file is specified by the command line\&. At that point, the new config file is read, and any previous options set by a command line option, would be overridden\&.
.SH "AUTHOR"
.PP
Written by Greg Kroah\-Hartman <greg@kroah\&.com> and Amir Mohammad Saied <amirsaied@gmail\&.com>\&.
fprintf(stdout, " --proxy PROXY:PORT\n");
fprintf(stdout, " --host HOST\n");
fprintf(stdout, " --logfile logfile\n");
+ fprintf(stdout, " --config configfile\n");
fprintf(stdout, " --shrink-urls\n");
fprintf(stdout, " --page PAGENUMBER\n");
fprintf(stdout, " --bash\n");
{ "dry-run", 0, NULL, 'n' },
{ "page", 1, NULL, 'g' },
{ "version", 0, NULL, 'v' },
+ { "config", 1, NULL, 'c' },
{ }
};
struct session *session;
parse_configfile(session);
while (1) {
- option = getopt_long_only(argc, argv, "dp:P:H:a:A:u:hg:G:snVv",
+ option = getopt_long_only(argc, argv, "dp:P:H:a:A:u:c:hg:G:snVv",
options, NULL);
if (option == -1)
break;
case 'b':
session->bash = 1;
break;
+ case 'c':
+ if (session->configfile)
+ free(session->configfile);
+ session->configfile = strdup(optarg);
+ dbg("configfile = %s\n", session->configfile);
+
+ /*
+ * read the config file now. Yes, this could override previously
+ * set options from the command line, but the user asked for it...
+ */
+ parse_configfile(session);
+ break;
case 'h':
display_help();
goto exit;
<arg><option>--host HOST_NAME</option></arg>
<arg><option>--proxy PROXY:PORT</option></arg>
<arg><option>--logfile LOGFILE</option></arg>
+ <arg><option>--config CONFIGFILE</option></arg>
<arg><option>--page PAGENUMBER</option></arg>
<arg><option>--bash</option></arg>
<arg><option>--shrink-urls</option></arg>
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--config CONFIGFILE</option></term>
+ <listitem>
+ <para>
+ Specify a config file for bti to read from. By default, bti
+ looks in the ~/.bti file for config values. This default
+ location can be overridden by setting a specific file with this
+ option.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term><option>--shrink-urls</option></term>
<listitem>
</variablelist>
<para>
For example, command line options always override any config file
- option, or any environment variables.
+ option, or any environment variables. Unless a config file is
+ specified by the command line. At that point, the new config file is
+ read, and any previous options set by a command line option, would be
+ overridden.
</para>
</refsect1>