mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Rob Browning's update to gnc-prices.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3792 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
gncsharedir = ${GNC_SHAREDIR}
|
||||
|
||||
bin_SCRIPTS = gnc-prices
|
||||
gncshare_SCRIPTS=finance-quote-helper
|
||||
|
||||
EXTRA_DIST = \
|
||||
|
||||
@@ -278,45 +278,46 @@ while(<>) {
|
||||
}
|
||||
|
||||
my($quote_method_name, $symbols) = @$result;
|
||||
my $quote_data = undef;
|
||||
|
||||
my %quote_data;
|
||||
|
||||
SWITCH:
|
||||
{
|
||||
if($quote_method_name =~ m/^yahoo$/) {
|
||||
$quote_data = $quoter->yahoo(@$symbols);
|
||||
%quote_data = $quoter->yahoo(@$symbols);
|
||||
last SWITCH;
|
||||
}
|
||||
if($quote_method_name =~ m/^yahoo_europe$/) {
|
||||
$quote_data = $quoter->yahoo_europe(@$symbols);
|
||||
%quote_data = $quoter->yahoo_europe(@$symbols);
|
||||
last SWITCH;
|
||||
}
|
||||
if($quote_method_name =~ m/^fidelity_direct$/) {
|
||||
$quote_data = $quoter->fidelity_direct(@$symbols);
|
||||
%quote_data = $quoter->fidelity_direct(@$symbols);
|
||||
last SWITCH;
|
||||
}
|
||||
if($quote_method_name =~ m/^troweprice_direct$/) {
|
||||
$quote_data = $quoter->troweprice_direct(@$symbols);
|
||||
%quote_data = $quoter->troweprice_direct(@$symbols);
|
||||
last SWITCH;
|
||||
}
|
||||
}
|
||||
if($quote_method_name =~ m/^vanguard$/) {
|
||||
$quote_data = $quoter->vanguard(@$symbols);
|
||||
%quote_data = $quoter->vanguard(@$symbols);
|
||||
last SWITCH;
|
||||
}
|
||||
}
|
||||
if($quote_method_name =~ m/^asx$/) {
|
||||
$quote_data = $quoter->asx(@$symbols);
|
||||
%quote_data = $quoter->asx(@$symbols);
|
||||
last SWITCH;
|
||||
}
|
||||
}
|
||||
if($quote_method_name =~ m/^tiaacref$/) {
|
||||
$quote_data = $quoter->tiaacref(@$symbols);
|
||||
%quote_data = $quoter->tiaacref(@$symbols);
|
||||
last SWITCH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$quote_data) {
|
||||
if(!%quote_data) {
|
||||
print "#f\n";
|
||||
exit 1;
|
||||
}
|
||||
print schemify_quotes($symbols, $quote_data);
|
||||
|
||||
print schemify_quotes($symbols, \%quote_data);
|
||||
STDOUT->flush();
|
||||
}
|
||||
|
||||
|
||||
23
src/quotes/gnc-prices
Executable file
23
src/quotes/gnc-prices
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Usage: gnc-prices <datafile>
|
||||
|
||||
# Vestigal script for adding current prices to a gnucash data file for
|
||||
# all the accounts having a price source.
|
||||
|
||||
if [ "$#" -ne 1 ]
|
||||
then
|
||||
echo "Usage: gnc-prices <file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "gnc-prices is obsolete: "
|
||||
|
||||
if [ "$1"x = x ]
|
||||
then
|
||||
echo "please use gnucash --add-price-quotes <file>"
|
||||
else
|
||||
echo "please use gnucash --add-price-quotes $1"
|
||||
fi
|
||||
|
||||
exec gnucash --add-price-quotes "$1"
|
||||
Reference in New Issue
Block a user