Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor sympa.pl #1286

Merged
merged 10 commits into from Dec 18, 2021
Merged

Refactor sympa.pl #1286

merged 10 commits into from Dec 18, 2021

Conversation

ikedas
Copy link
Member

@ikedas ikedas commented Dec 4, 2021

  • 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
Copy link
Contributor

racke commented Dec 4, 2021

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

@ikedas
Copy link
Member Author

ikedas commented Dec 6, 2021

@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
Copy link
Contributor

racke commented Dec 6, 2021

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
Copy link
Member Author

ikedas commented Dec 10, 2021

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

EDIT: See the table in #1303.

@racke
Copy link
Contributor

racke commented Dec 10, 2021

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
Copy link
Contributor

racke commented Dec 10, 2021

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

@ikedas
Copy link
Member Author

ikedas commented Dec 10, 2021

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
Copy link
Contributor

racke commented Dec 10, 2021

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
Copy link
Contributor

racke commented Dec 10, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants