diff options
| author | 2024-11-25 10:24:47 +0100 | |
|---|---|---|
| committer | 2024-11-25 10:24:47 +0100 | |
| commit | b3be8e06734c6428376514024af7cabf13774dce (patch) | |
| tree | f7e655e55c208270e729b9a0fec0ec22f8196282 /main.c | |
| parent | Most CSV import code has been moved to their own functions. (diff) | |
| download | penes-snac2-b3be8e06734c6428376514024af7cabf13774dce.tar.gz penes-snac2-b3be8e06734c6428376514024af7cabf13774dce.tar.xz penes-snac2-b3be8e06734c6428376514024af7cabf13774dce.zip | |
New cmdline ops 'import_list' and 'import_block_list'.
Diffstat (limited to '')
| -rw-r--r-- | main.c | 14 |
1 files changed, 14 insertions, 0 deletions
| @@ -52,6 +52,8 @@ int usage(void) | |||
| 52 | printf("alias {basedir} {uid} {account} Sets account (@user@host or actor url) as an alias\n"); | 52 | printf("alias {basedir} {uid} {account} Sets account (@user@host or actor url) as an alias\n"); |
| 53 | printf("migrate {basedir} {uid} Migrates to the account defined as the alias\n"); | 53 | printf("migrate {basedir} {uid} Migrates to the account defined as the alias\n"); |
| 54 | printf("import_csv {basedir} {uid} Imports data from CSV files into current directory\n"); | 54 | printf("import_csv {basedir} {uid} Imports data from CSV files into current directory\n"); |
| 55 | printf("import_list {basedir} {uid} {file} Imports a Mastodon CSV list file\n"); | ||
| 56 | printf("import_block_list {basedir} {uid} {file} Imports a Mastodon CSV block list file\n"); | ||
| 55 | 57 | ||
| 56 | return 1; | 58 | return 1; |
| 57 | } | 59 | } |
| @@ -589,6 +591,18 @@ int main(int argc, char *argv[]) | |||
| 589 | return 0; | 591 | return 0; |
| 590 | } | 592 | } |
| 591 | 593 | ||
| 594 | if (strcmp(cmd, "import_list") == 0) { /** **/ | ||
| 595 | import_list_csv(&snac, url); | ||
| 596 | |||
| 597 | return 0; | ||
| 598 | } | ||
| 599 | |||
| 600 | if (strcmp(cmd, "import_block_list") == 0) { /** **/ | ||
| 601 | import_blocked_accounts_csv(&snac, url); | ||
| 602 | |||
| 603 | return 0; | ||
| 604 | } | ||
| 605 | |||
| 592 | if (strcmp(cmd, "note") == 0) { /** **/ | 606 | if (strcmp(cmd, "note") == 0) { /** **/ |
| 593 | xs *content = NULL; | 607 | xs *content = NULL; |
| 594 | xs *msg = NULL; | 608 | xs *msg = NULL; |