Feature #16070

Support bash glob in donors-report

Added by sajolida 2018-10-23 21:15:13 . Updated 2019-08-07 09:42:54 .

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

0%

Feature Branch:
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:

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.


Subtasks


Related issues

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

History

#1 Updated by sajolida 2018-10-23 21:15:28

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

#2 Updated by mercedes508 2019-01-27 15:11:09

  • Status changed from New to Confirmed

#3 Updated by sajolida 2019-07-30 10:33:01

#4 Updated by sajolida 2019-07-30 10:51:45

  • Target version set to Tails_3.16

#5 Updated by intrigeri 2019-08-06 17:14:54

  • 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 2019-08-07 09:06:29

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

#7 Updated by sajolida 2019-08-07 09:09:09

  • 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 2019-08-07 09:09:40

And I’m fine with “donors-report” :)

#9 Updated by intrigeri 2019-08-07 09:42:54

> And I’m fine with “donors-report” :)

Renamed.