Permalink
Browse files

version 0.1.3

 * renamed oauth_utils to oauth-utils
 * debianized it
 * fixed typos, built-env and updated example.sh
 * changed parser to allow than two return parameters (xoauth_)
  • Loading branch information...
1 parent cbb375e commit 321089119f8c08779fe4c81f3df58cddea831a9f @x42 committed Oct 17, 2008
View
7 ChangeLog
@@ -1,4 +1,11 @@
2008-10-16 Robin Gareus <robin@gareus.org>
+ * version 0.1.3
+ * renamed oauth_utils to oauth-utils
+ * debianized it
+ * fixed typos, built-env and updated example.sh
+ * changed parser to allow than two return parameters (xoauth_)
+
+2008-10-16 Robin Gareus <robin@gareus.org>
* version 0.1.0
* oauthsign works and is mostly documented.
View
8 Makefile.am
@@ -1,16 +1,16 @@
SUBDIRS = src
EXTRA_DIST= \
- oauth_utils.lsm.in \
- oauth_utils.spec.in \
- doc/oauth_utils.7 \
+ oauth-utils.lsm.in \
+ oauth-utils.spec.in \
+ doc/oauth-utils.7 \
doc/oauthsign.1 \
doc/example.sh
TESTS=doc/example.sh
# install the man pages
-man_MANS=doc/oauth_utils.7 doc/oauthsign.1
+man_MANS=doc/oauth-utils.7 doc/oauthsign.1
MAINTAINERCLEANFILES = \
Makefile.in \
View
4 README
@@ -1,6 +1,4 @@
- oauth_utils - command line utilities for oauth
-
-
+ oauth-utils - command line utilities for oauth
Copyright (C) 2008 Robin Gareus
View
16 configure.ac
@@ -1,21 +1,19 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(oauthsign.c)
+AC_INIT([oauth-utils], [0.1.3], [robin AT gareus DOT org])
AC_CONFIG_SRCDIR(src/oauthsign.c)
-dnl Every other copy of the package version number gets its value from here
-AM_INIT_AUTOMAKE(oauth_utils, 0.1.2)
-
-dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
-AM_CONFIG_HEADER(config.h)
+AC_CANONICAL_TARGET([])
+AC_COPYRIGHT([Copyright (C) Robin Gareus 2008])
+AM_INIT_AUTOMAKE(oauth-utils, $PACKAGE_VERSION)
+AM_CONFIG_HEADER(src/config.h)
AC_SUBST(VERSION)
-
-dnl used for lsm.in
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
AC_CANONICAL_HOST
+AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
dnl Checks for programs.
AC_PROG_INSTALL
@@ -48,4 +46,4 @@ PKG_CHECK_MODULES(OAUTH, oauth, HAVE_OAUTH=yes,
point the path where liboauth installed it's .pc files.
]))
-AC_OUTPUT(Makefile src/Makefile oauth_utils.lsm oauth_utils.spec)
+AC_OUTPUT(Makefile src/Makefile oauth-utils.lsm oauth-utils.spec)
View
6 debian/changelog
@@ -0,0 +1,6 @@
+oauth-utils (0.1.3-1) unstable; urgency=low
+
+ * Initial release
+
+ -- Robin Gareus <robin@gareus.org> Fri, 17 Oct 2008 11:02:39 +0200
+
View
1 debian/compat
@@ -0,0 +1 @@
+7
View
15 debian/control
@@ -0,0 +1,15 @@
+Source: oauth-utils
+Section: web
+Priority: extra
+Maintainer: Robin Gareus <robin@gareus.org>
+Build-Depends: debhelper (>= 7), autotools-dev, liboauth-dev
+Standards-Version: 3.7.3
+Homepage: http://mir.dnsalias.com/oss/oauth/start
+
+Package: oauth-utils
+Architecture: any
+Depends: liboauth, ${shlibs:Depends}, ${misc:Depends}
+Recommends: curl
+Description: command line utilities for oauth
+ command line oAuth consumer in the style of curl
+ using liboauth.sf.net
View
19 debian/copyright
@@ -0,0 +1,19 @@
+This package was debianized by Robin Gareus <robin@gareus.org> on
+Fri, 17 Oct 2008 11:02:39 +0200.
+
+It was downloaded from http://mir.dnsalias.com/_media/oss/oauth/oauth-utils-0.1.3.tar.gz
+
+Upstream Author(s):
+
+ Robin Gareus <robin@gareus.org>
+
+Copyright:
+
+ <Copyright (C) 2008 Robin gareus>
+
+License:
+
+ GPL v2 or later.
+
+The Debian packaging is (C) 2008, Robin Gareus <robin@gareus.org> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
View
1 debian/dirs
@@ -0,0 +1 @@
+usr/bin
View
4 debian/docs
@@ -0,0 +1,4 @@
+NEWS
+README
+doc/example.sh
+doc/example.sh
View
140 debian/rules
@@ -0,0 +1,140 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+#
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets by Bill Allombert 2001
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+else
+CROSS= --build $(DEB_BUILD_GNU_TYPE)
+endif
+
+
+
+
+
+config.status: configure
+ dh_testdir
+ # Add here commands to configure the package.
+ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+ cp -f /usr/share/misc/config.sub config.sub
+endif
+ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+ cp -f /usr/share/misc/config.guess config.guess
+endif
+ ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
+
+
+#Architecture
+build: build-arch build-indep
+
+build-arch: build-arch-stamp
+build-arch-stamp: config.status
+
+ # Add here commands to compile the arch part of the package.
+ #$(MAKE)
+ touch $@
+
+build-indep: build-indep-stamp
+build-indep-stamp: config.status
+
+ # Add here commands to compile the indep part of the package.
+ #$(MAKE) doc
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-arch-stamp build-indep-stamp
+
+ # Add here commands to clean up after the build process.
+ [ ! -f Makefile ] || $(MAKE) distclean
+ rm -f config.sub config.guess
+
+ dh_clean
+
+install: install-indep install-arch
+install-indep:
+ dh_testdir
+ dh_testroot
+ dh_clean -k -i
+ dh_installdirs -i
+
+ # Add here commands to install the indep part of the package into
+ # debian/<package>-doc.
+ #INSTALLDOC#
+
+ echo "doc/example.sh" >> $(CURDIR)/debian/docs
+ install -m 644 doc/example.sh $(CURDIR)/debian/oauth-utils/usr/share/doc/oauth-utils/
+
+ dh_install -i
+
+install-arch:
+ dh_testdir
+ dh_testroot
+ dh_clean -k -s
+ dh_installdirs -s
+
+ # Add here commands to install the arch part of the package into
+ # debian/tmp.
+ $(MAKE) DESTDIR=$(CURDIR)/debian/oauth-utils install
+
+ dh_install -s
+# Must not depend on anything. This is to be called by
+# binary-arch/binary-indep
+# in another 'make' thread.
+binary-common:
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs ChangeLog
+ dh_installdocs
+ dh_installexamples
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+# Build architecture independant packages using the common target.
+binary-indep: build-indep install-indep
+ $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+
+# Build architecture dependant packages using the common target.
+binary-arch: build-arch install-arch
+ $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
+
+binary: binary-arch binary-indep
+.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch
View
12 doc/example.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+CONFIGFILE=${1:-"./oauthconf"}
+
OAUTHSIGN=./src/oauthsign
if ! test -x $OAUTHSIGN; then
OAUTHSIGN=../src/oauthsign
@@ -23,11 +25,13 @@ ACT="access_token.php"
TST="echo_api.php?method=foo%20bar&bar=baz"
# read config file - override above settings
-CONFIGFILE="./oauthconf"
if [ -e $CONFIGFILE ]; then
. $CONFIGFILE
fi
+echo " --- oauthsign test and example"
+echo " --- connecting to $BASEURL"
+
TOKENFILE=`mktemp /tmp/oauth.XXXXXXXXXX` || exit 1
function cleanup {
@@ -36,12 +40,14 @@ function cleanup {
trap cleanup EXIT
echo " +++ getting request token.."
-$OAUTHSIGN -X -f $TOKENFILE -w -e -c $CONKEY -C $CONSEC "${BASEURL}${DOPARAM}${RQT}" || ( echo " !!! no request token returned."; exit 1;) || exit 1;
+#echo " --- URL: ${BASEURL}${DOPARAM}${RQT}"
+$OAUTHSIGN -X -f $TOKENFILE -w -e -c "$CONKEY" -C "$CONSEC" "${BASEURL}${DOPARAM}${RQT}" || ( echo " !!! no request token returned."; exit 1;) || exit 1;
if [ -n "$AUT" ]; then
REQTOK=$(cat $TOKENFILE | awk '/oauth_token_key=(.*)/{ print substr($1,17);}')
+ echo " +++ Authorization."
echo "visit: ${BASEURL}${DOPARAM}${AUT}&oauth_token=${REQTOK}"
- echo -n "Authorize request token and press enter.."
+ echo -n "to authorize this request token and press enter.."
read
echo
fi
View
8 doc/oauth_utils.7 → doc/oauth-utils.7
@@ -1,5 +1,5 @@
.\" hey, Emacs: -*- nroff -*-
-.\" oauth_utils is free software; you can redistribute it and/or modify
+.\" oauth-utils is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
@@ -27,12 +27,12 @@
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
-oauth_utils \- command line utilities for oauth
+oauth-utils \- command line utilities for oauth
.SH About
-\fBoauth_utils\fP washes your windows, mends your fences, mows your lawn...
+\fBoauth-utils\fP washes your windows, mends your fences, mows your lawn...
.PP
.SH "SEE ALSO"
.BR oauthsign (1),
-.BR oauthrawpost (1).
+.\" .BR oauthrawpost (1).
.SH AUTHOR
Robin Gareus <robin@gareus.org>.
View
105 doc/oauthsign.1
@@ -0,0 +1,105 @@
+.\" hey, Emacs: -*- nroff -*-
+.\" oauth-utils is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program; see the file COPYING. If not, write to
+.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+.\"
+.TH OAUTHSIGN 1 "October 16, 2008"
+.\" Please update the above date whenever this man page is modified.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins (default)
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.\"
+.\" defines for verbose text
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.de URL
+\\$2 \(laURL: \\$1 \(ra\\$3
+..
+
+.SH NAME
+oauthsign \- oauth command line tool
+.SH SYNOPSIS
+.B oauthsign
+.RI [ options ]
+.RI < URL >
+.RI [ CKey ]
+.RI [ CSec ]
+.RI [ TKey ]
+.RI [ Tsec ]
+.SH DESCRIPTION
+\fBoauthsign\fP offers a simple way to generate or make OAuth signed HTTP requests.
+.PP
+\fBoauthsign\fP implements an OAuth consumer...
+.SH OPTIONS
+\fBoauthsign\fP accepts the following options:
+.TP
+.B --dry-run
+Take no real actions.
+.TP
+.B --no-warn
+Disable warnings.
+.TP
+.BR -q , " --quiet" , " --silent"
+Inhibit usual output.
+.TP
+.B -v, --verbose
+Print more information.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-V, \-\-version
+Show version of program.
+.TP
+.B ...
+for all options, run
+.PP
+.Vb 1
+\& oauthsign \-h
+.Ve
+.SH EXAMPLE
+run the following commands in sequence to walk though an
+.URL "http://term.ie/oauth/example/" "OAuth example".
+Connecting to the server requires online connectivity. The file \fI/tmp/test.oaf\fP is used to store the OAuth tokens between the requests.
+
+.PP
+.Vb 1
+\&oauthsign \-X \-f /tmp/test.oaf \-w \-e \-c key \-C secret http://term.ie/oauth/example/request_token.php
+\&oauthsign \-X \-f /tmp/test.oaf \-w http://term.ie/oauth/example/access_token.php
+\&oauthsign \-x \-f /tmp/test.oaf "http://term.ie/oauth/example/echo_api.php?method=foo%20bar&bar=baz"
+\&oauthsign \-x \-f /tmp/test.oaf \-d method=foo%20bar \-d "bar=baz &test%" \-\-post http://term.ie/oauth/example/echo_api.php
+.Ve
+
+.SH "SEE ALSO"
+.BR oauth-utils (7).
+.SH AUTHOR
+oauth-utils was written by Robin Gareus <robin@gareus.org>.
+.PP
+This manual page was also written by Robin Gareus <robin@gareus.org>,
+for the Debian project (but may be used by others).
+
View
10 oauth_utils.lsm.in → oauth-utils.lsm.in
@@ -1,14 +1,12 @@
Begin3
-Title: oauth_utils
+Title: oauth-utils
Version: @VERSION@
Entered-date: @ISODATE@
Description: command line utilities for oauth
@configure_input@
- Please edit oauth_utils.lsm.in to fix the Keywords and
- Primary-site entries, add several more lines of
- description here if appropriate, and to delete these
- instructions.
-Keywords: [substitute your keywords here]
+ a command line oAuth consumer in the style of curl
+ using liboauth.sf.net
+Keywords: oAuth, CLI
Author: robin@gareus.org (Robin Gareus)
Maintained-by: robin@gareus.org (Robin Gareus)
Primary-site: metlab.unc.edu pub/Linux/apps/some/directory
View
8 oauth_utils.spec.in → oauth-utils.spec.in
@@ -1,8 +1,8 @@
-# oauth_utils.spec
+# oauth-utils.spec
#
# Copyright (c) 2008 Robin Gareus robin@gareus.org
#
-%define name oauth_utils
+%define name oauth-utils
%define version @VERSION@
%define release 1
%define manifest %{_builddir}/%{name}-%{version}-%{release}.manifest
@@ -41,9 +41,7 @@ Summary: command line utilities for oauth
%description
command line utilities for oauth
@configure_input@
-Please edit oauth_utils.spec.in to add several more lines of description
-here if appropriate, and to delete these instructions.
-
+a command line oAuth consumer.
%prep
%setup -q
#%patch0 -p1
View
18 src/keyfile.c
@@ -40,7 +40,8 @@ int parseoption (oauthparam *op, char *item, char *value) {
int rv =0;
if (!strncasecmp(item,"oauth_consumer_key",18)) {
if(op->c_key) free(op->c_key);
- op->c_key=xstrdup(value); rv|=1;
+ op->c_key=xstrdup(value);
+ if (strlen(value)>0) rv|=1;
}
else if (!strncasecmp(item,"oauth_consumer_secret",21)) {
if(op->c_secret) free(op->c_secret);
@@ -55,16 +56,7 @@ int parseoption (oauthparam *op, char *item, char *value) {
op->t_secret=xstrdup(value); rv|=1;
}
else if (!strncasecmp(item,"oauth_signature_method",22)) {
- if (!strcmp(value, "PLAINTEXT")) {
- op->signature_method = OA_RSA;
- rv|=1;
- } else if (!strcmp(value, "RSA-SHA1")) {
- op->signature_method = OA_RSA;
- rv|=1;
- } else if (!strcmp(value, "HMAC-SHA1")) {
- op->signature_method = OA_HMAC;
- rv|=1;
- }
+ if (!parse_oauth_method(op, value)) rv|=1;
}
return rv;
}
@@ -90,9 +82,7 @@ int read_keyfile(char *fn, oauthparam *op) {
item=strdup(token);
token = strtok( NULL, "\t =&\n\r" ) ;
if (!token) {
- free(item);
- fprintf(stderr, "ERROR parsing config file. %s:%d\n",fn,lineno);
- exit(1);
+ token=xstrdup("");
}
if (!parseoption(op,item,token)) {
fprintf(stderr, "ERROR parsing config file. %s:%d\n",fn,lineno);
View
16 src/oauth_common.c
@@ -33,6 +33,20 @@
extern int want_quiet;
extern int want_verbose;
+int parse_oauth_method(oauthparam *op, char *value) {
+ if (!strcmp(value, "PLAINTEXT")) {
+ op->signature_method = OA_RSA;
+ return (0);
+ } else if (!strcmp(value, "RSA-SHA1")) {
+ op->signature_method = OA_RSA;
+ return (0);
+ } else if (!strcmp(value, "HMAC-SHA1")) {
+ op->signature_method = OA_HMAC;
+ return (0);
+ }
+ return (-1);
+}
+
#if 0 // obsolte
int oauthrequest (int mode, oauthparam *op) {
if (mode&2==0) { // GET
@@ -112,7 +126,7 @@ int parse_reply(const char *reply, char **token, char **secret) {
rc = oauth_split_url_parameters(reply, &rv);
//if (rc>0)
qsort(rv, rc, sizeof(char *), oauth_cmpstringp);
- if( rc==2
+ if( rc>=2
&& !strncmp(rv[0],"oauth_token=",11)
&& !strncmp(rv[1],"oauth_token_secret=",18) ) {
ok=0;
View
4 src/oauth_common.h 100755 → 100644
@@ -30,6 +30,7 @@ typedef struct {
//char *request_method; //< GET, POST, PUT,
} oauthparam;
+// common oauth functions
char *oauthsign (int mode, oauthparam *op);
char *oauthsign_ext (int mode, oauthparam *op, int optargc, char **optargv, int *saveargcp, char ***saveargvp);
//int oauthsign_alt (int mode, oauthparam *op);
@@ -48,6 +49,9 @@ void add_param_to_array(int *argcp, char ***argvp, char *addparam);
void add_kv_to_array(int *argcp, char ***argvp, char *key, char *val);
#endif
+// other common functions
+int parse_oauth_method(oauthparam *op, char *value);
+
// keyfile.c
int read_keyfile(char *fn, oauthparam *op);
int save_keyfile(char *fn, oauthparam *op);
View
77 src/oauthsign.c
@@ -92,21 +92,17 @@ static struct option const long_options[] =
{"CS", required_argument, 0, 'C'},
{"TK", required_argument, 0, 't'},
{"TS", required_argument, 0, 'T'},
+ {"signature-method", no_argument, 0, 'm'}, // oauth signature method
-
- {"request", required_argument, 0, 'r'},
+ {"request", required_argument, 0, 'r'}, // HTTP request method (GET, POST)
{"post", no_argument, 0, 'p'},
//{"escape-post-param", no_argument, 0, 'P'},
-
+ {"data", required_argument, 0, 'd'},
{"base-url", no_argument, 0, 'B'},
{"base-string", no_argument, 0, 'b'},
- {"data", required_argument, 0, 'd'},
-
-//{"method", no_argument, 0, 'm'}, // TODO - oauth signature method
-
{"file", required_argument, 0, 'f'},
- {"write", no_argument, 0, 'w'}, // only if '-f' given.
+ {"write", no_argument, 0, 'w'},
//{"writefile", required_argument, 0, 'F'},
//{"execute", no_argument, 0, 'x'},
//{"oauthrequest", no_argument, 0, 'X'},
@@ -136,28 +132,31 @@ static int decode_switches (int argc, char **argv) {
int c;
while ((c = getopt_long (argc, argv,
- "q" /* quiet or silent */
- "v" /* verbose */
"h" /* help */
"V" /* version */
+ "q" /* quiet or silent */
+ "v" /* verbose */
+ "b" /* base-string*/
+ "B" /* base-URL*/
+ "r:" /* HTTP Request method */
+ "p" /* post */
+ "d:" /* URL-query parameter data eg.
+ * '-d name=daniel -d skill=lousy'->'name=daniel&skill=lousy' */
+ "m:" /* oauth signature Method */
+ "P" /* print escaped post parameters */
+
"c:" /* consumer-key*/
"C:" /* consumer-secret */
"t:" /* token-key*/
"T:" /* token-secret */
- "r:" /* request */
- "e" /* erase token */
- "E" /* erase token and conusmer */
- "p" /* post */
- "P" /* print escaped post parameters */
- "B" /* base-URL*/
- "b" /* base-string*/
- "d:" /* URL-query parameter data eg.
- * '-d name=daniel -d skill=lousy'->'name=daniel&skill=lousy' */
+
"f:" /* read key/data file */
- "F:" /* set key/data filename */
"w" /* write to key/data file, save request/access token state */
+ "F:" /* set key/data filename */
"x" /* execute */
- "X", /* execute and parse reply */
+ "X" /* execute and parse reply */
+ "e" /* erase token */
+ "E", /* erase token and conusmer */
long_options, (int *) 0)) != EOF) {
switch (c) {
case 'q': /* --quiet, --silent */
@@ -170,7 +169,11 @@ static int decode_switches (int argc, char **argv) {
want_dry_run = 1;
break;
case 'V':
- printf ("oauth_urils %s\n", VERSION);
+ printf ("%s %s (%s)", PACKAGE, VERSION, OS);
+ #ifdef LIBOAUTH_VERSION
+ printf (" liboauth/%s", LIBOAUTH_VERSION);
+ #endif
+ printf ("\n");
exit (0);
case 'b':
@@ -238,6 +241,9 @@ static int decode_switches (int argc, char **argv) {
case 'P':
mode|=256;
break;
+ case 'm':
+ if (parse_oauth_method(&op, optarg)) usage(1);
+ break;
case 'h':
usage (0);
@@ -261,25 +267,32 @@ Options:\n\
-V, --version output version information and exit\n\
-q, --quiet, --silent inhibit usual output\n\
-v, --verbose print more information\n\
+ \n\
-b, --base-string print OAuth base-string and exit\n\
-B, --base-url print OAuth base-URL and exit\n\
- -r, --request HTTP request type (POST, GET)\n\
+ -r, --request HTTP request type (POST, GET [default])\n\
-p, --post same as -r POST\n\
-d, --data <key>[=<val>] add url query parameters.\n\
+ -m, --signature-method oauth signature method (PLAINTEXT,\n\
+ RSA-SHA1, HMAC-SHA1 [default])\n\
+"/*
+ -P, URL escape POST parameters \n\
+*/"\
\n\
- -c, --CK, --consumer-key <text>\n\
- -C, --CS, --consumer-secret <text> \n\
- -t, --TK, --token-key <text> \n\
- -T, --TS, --token-secret <text> \n\
+ -c, --CK, --consumer-key <text> \n\
+ -C, --CS, --consumer-secret <text> \n\
+ -t, --TK, --token-key <text> \n\
+ -T, --TS, --token-secret <text> \n\
\n\
-f, --file <filename> read tokens and secrets from config-file\n\
- --dry-run take no real actions (with -x or -X)\n\
- -x make HTTP request and return the replied content\n\
- -X make HTTP request and parse the reply for tokens\n\
-w write tokens to config-file\n\
-F <filename> set config-file name w/o reading the file.\n\
- -e, --erase-token clear [access|request] token settings.\n\
- -E, --erase-all wipe [access|request] and consumer token settings.\n\
+ -x make HTTP request and return the replied content\n\
+ -X make HTTP request and parse the reply for tokens\n\
+ use '-X -w' to request and store tokens.\n\
+ -e, --erase-token clear [access|request] tokens.\n\
+ -E, --erase-all wipe all tokens and reset method to HMAC-SHA1.\n\
+ --dry-run take no real actions (with -x, -w or -X)\n\
\n\
The position of parameters -d, -f, -F, -e, -E and all tokens matters!\n\
\n\
View
2 src/system.h
@@ -1,4 +1,4 @@
-/* system-dependent definitions for oauth_utils
+/* system-dependent definitions for oauth-utils
Written for GNU fileutils.
Adapted for autoproject by James R. Van Zandt.
View
2 src/xmalloc.c
@@ -77,7 +77,7 @@ fixup_null_alloc (n)
{
/* possible revisions: release some memory and re-try, print
more information (e.g. line number of input file) */
- fprintf(stderr, _("oauth_utils: Memory exhausted"));
+ fprintf(stderr, _("oauth-utils: Memory exhausted"));
exit(1);
}
return p;

0 comments on commit 3210891

Please sign in to comment.