Skip to content

Refactor sympa.pl#1286

Merged
ikedas merged 10 commits into
sympa-community:sympa-6.2from
ikedas:refactor_sympa.pl
Dec 18, 2021
Merged

Refactor sympa.pl#1286
ikedas merged 10 commits into
sympa-community:sympa-6.2from
ikedas:refactor_sympa.pl

Conversation

@ikedas

@ikedas ikedas commented Dec 4, 2021

Copy link
Copy Markdown
Member
  • Split functions of sympa.pl into submodules.
  • Rename and merge some of sympa.pl commands: "sympa.pl --add=list@dom ..." to "sympa.pl add ... list@dom" and so on.
  • sympa.pl was renamed to sympa, and with a symlink, older name is still usable.

See POD in sympa.pl.in and Sympa/CLI/*.pm about changes.

  --add_list & --create_list                  => create
  --close_family, --close_list & --purge_list => close
  --copy_list & --rename_list                 => move
  --dump_users                                => dump
  --modify_list                               => update
  --open_list                                 => open
  --restore_users                             => restore
@ikedas ikedas added this to the 6.2.68 milestone Dec 4, 2021
@racke

racke commented Dec 4, 2021

Copy link
Copy Markdown
Contributor

Great idea! Makes it a lot easier to add new commands as well. 👍

@ikedas

ikedas commented Dec 6, 2021

Copy link
Copy Markdown
Member Author

@racke, I have anothor idea that sympa.pl would be renamed to sympa (It might be better to leave the link to sympa.pl for backward compatibility).

@racke

racke commented Dec 6, 2021

Copy link
Copy Markdown
Contributor

Yes, please do so! I already doing that in the Debian package and in my Ansible role.

  --change_user_email  => user move
  --health_check       => check
  --instantiate_family => instantiate
  --sync_include       => include
@ikedas ikedas force-pushed the refactor_sympa.pl branch from e8e7ae4 to 3fa3a86 Compare December 8, 2021 04:52
@ikedas

ikedas commented Dec 10, 2021

Copy link
Copy Markdown
Member Author

Changes on command line (note that older form may still be usable).

EDIT: See the table in #1303.

@racke

racke commented Dec 10, 2021

Copy link
Copy Markdown
Contributor

Looks nice 👍

sympa move --copy listname@robot newlistname@newrobot

This should be really sympa copy, otherwise it is quite confusing and too much to type.

@racke

racke commented Dec 10, 2021

Copy link
Copy Markdown
Contributor

Maybe you can post that new schema on the mailing list for more feedback?

@ikedas

ikedas commented Dec 10, 2021

Copy link
Copy Markdown
Member Author

sympa move --copy listname@robot newlistname@newrobot

This should be really sympa copy, otherwise it is quite confusing and too much to type.

sympa move --copy sympa move --mode=copy and sympa move use the same Sympa::Request handler. It sounds true that this is not intuitive for the user.

I think of two:

  • Add sympa copy as an alias of sympa move --copy sympa move --mode=copy.
  • All changes will be subject to prompt confirmation, and that behavior can be overridden with any option, such as -y, --assume-yes.

Eventually, I'd like to integrate the other command line tools into sympa, including sympa_wizard and miscellaneous utilities under src/bin.


EDIT: Typos.

@racke

racke commented Dec 10, 2021

Copy link
Copy Markdown
Contributor

Alias is an idea to solve the "move --copy" predicament. You could also add CLI::copy which inherits CLI::Move. Integration the other CLI tools is also a really good idea 👍

@racke

racke commented Dec 10, 2021

Copy link
Copy Markdown
Contributor

I'm not a friend of a prompt confirmation. If you want to do that, please add a configuration option to waive that confirmation without requiring -y.

@ikedas ikedas merged commit 3ee40dd into sympa-community:sympa-6.2 Dec 18, 2021
ikedas added a commit that referenced this pull request Jan 12, 2022
@ikedas ikedas mentioned this pull request Feb 8, 2022
@ikedas ikedas deleted the refactor_sympa.pl branch April 20, 2022 11:21
@sympa-community sympa-community locked as resolved and limited conversation to collaborators Oct 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants