Project

General

Profile

Feature #16070

Feature #16096: Donation campaign 2019

Support bash glob in donors-report

Added by sajolida 12 months ago. Updated 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Fundraising
Target version:
Start date:
10/23/2018
Due date:
% Done:

0%

Feature Branch:
Type of work:
Code
Blueprint:
Starter:
Affected tool:

Description

I had to use the following command to generate the list this time:

./scripts/report \
  -p data/PayPal_Zwiebelfreunde_2014-08-11_to_2015-12-31.csv \
  -p data/PayPal_RiseupLabs_2016-10-01_to_2016-12-31.csv \
  -p data/PayPal_RiseupLabs_2017-01-01_to_2017-12-31.csv \
  -p data/PayPal_RiseupLabs_2018-01-01_to_2018-01-31.csv

With > 1700 results.

While when doing:

./scripts/report -p data/*.csv

I get 833 reports.

The script should either support bash glob or warn that it doesn't (because it proven to be confusing for both Ulrike and me).

No hurry though :)

Off-topic: Having a distinctive name for this script would also help referring to it and searching for it in Redmine.


Related issues

Related to Tails - Bug #16056: Donor mail extraction script ignores unsubscribed Resolved 10/16/2018

History

#1 Updated by sajolida 12 months ago

  • Related to Bug #16056: Donor mail extraction script ignores unsubscribed added

#2 Updated by mercedes508 9 months ago

  • Status changed from New to Confirmed

#3 Updated by sajolida 3 months ago

  • Parent task set to #16096

#4 Updated by sajolida 3 months ago

  • Target version set to Tails_3.16

#5 Updated by intrigeri 2 months ago

  • Status changed from Confirmed to Needs Validation
  • Assignee changed from intrigeri to sajolida

Hi @sajolida!

First, thank you for expressing your needs via the target version. It helped me prioritize my work :)

The script should either support bash glob or warn that it doesn't (because it proven to be confusing for both Ulrike and me).

I see.

Strictly speaking, supporting shell globs is not possible: the script does not know that the user used a glob (the shell expands the glob before passing the script the list of matching files).

Having -p support an arbitrary number of files is hard and would be inconsistent with how most other Unix command line programs behave in this respect (an option that takes an argument typically takes it as one shell word and globs, expanded as a space-separated list, don't work there)… unless we simply look at all the files passed at the end of the command line and drop the need for -p, but then it would prevent us from ever supporting other input file formats, which would make me nervous.

So I did the best I could easily do without causing future trouble or other kinds of confusion: warning the user when they misunderstand the documentation.

Please test and report back :)

Off-topic: Having a distinctive name for this script would also help referring to it and searching for it in Redmine.

What about scripts/donors-report?

#6 Updated by sajolida 2 months ago

  • Subject changed from Support bash glob in donors script to Support bash glob in donors-report

#7 Updated by sajolida 2 months ago

  • Status changed from Needs Validation to Resolved
  • Assignee deleted (sajolida)

I understand better the constrains now. I'm fine with the solution that you provided because we're using this script only a couple of times a year and error prevention is much more important than efficiency here.

Thanks for the fix!

#8 Updated by sajolida 2 months ago

And I'm fine with "donors-report" :)

#9 Updated by intrigeri 2 months ago

And I'm fine with "donors-report" :)

Renamed.

Also available in: Atom PDF